Print this page
2904 hxge forgets C isn't math

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/hxge/hxge_kstats.c
          +++ new/usr/src/uts/common/io/hxge/hxge_kstats.c
↓ open down ↓ 885 lines elided ↑ open up ↑
 886  886   */
 887  887  int
 888  888  hxge_rx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val)
 889  889  {
 890  890          p_hxge_ring_handle_t    rhp = (p_hxge_ring_handle_t)rdriver;
 891  891          p_hxge_t                hxgep = rhp->hxgep;
 892  892  
 893  893          ASSERT(rhp != NULL);
 894  894          ASSERT(hxgep != NULL);
 895  895          ASSERT(hxgep->statsp != NULL);
 896      -        ASSERT(0 <= rhp->index < HXGE_MAX_RDCS);
      896 +        ASSERT((rhp->index >= 0) && (rhp->index < HXGE_MAX_RDCS));
 897  897  
 898  898          switch (stat) {
 899  899          case MAC_STAT_IERRORS:
 900  900                  *val = hxgep->statsp->rdc_stats[rhp->index].ierrors;
 901  901                  break;
 902  902          case MAC_STAT_RBYTES:
 903  903                  *val = hxgep->statsp->rdc_stats[rhp->index].ibytes;
 904  904                  break;
 905  905          case MAC_STAT_IPACKETS:
 906  906                  *val = hxgep->statsp->rdc_stats[rhp->index].ipackets;
↓ open down ↓ 11 lines elided ↑ open up ↑
 918  918   */
 919  919  int
 920  920  hxge_tx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val)
 921  921  {
 922  922          p_hxge_ring_handle_t    rhp = (p_hxge_ring_handle_t)rdriver;
 923  923          p_hxge_t                hxgep = rhp->hxgep;
 924  924  
 925  925          ASSERT(rhp != NULL);
 926  926          ASSERT(hxgep != NULL);
 927  927          ASSERT(hxgep->statsp != NULL);
 928      -        ASSERT(0 <= rhp->index < HXGE_MAX_TDCS);
      928 +        ASSERT((rhp->index >= 0) && (rhp->index < HXGE_MAX_TDCS));
 929  929  
 930  930          switch (stat) {
 931  931          case MAC_STAT_OERRORS:
 932  932                  *val = hxgep->statsp->tdc_stats[rhp->index].oerrors;
 933  933                  break;
 934  934          case MAC_STAT_OBYTES:
 935  935                  *val = hxgep->statsp->tdc_stats[rhp->index].obytes;
 936  936                  break;
 937  937          case MAC_STAT_OPACKETS:
 938  938                  *val = hxgep->statsp->tdc_stats[rhp->index].opackets;
↓ open down ↓ 452 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX