8789 usbgem: variable set but unused

Review Request #728 — Created Nov. 7, 2017 and submitted

tsoome
illumos-gate
8789
78c90dc...
general
../../common/io/usbgem/usbgem.c:925:6: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
  int ret;
      ^~~
../../common/io/usbgem/usbgem.c: In function 'usbgem_mac_ioctl':
../../common/io/usbgem/usbgem.c:3878:7: error: variable 'cmd' set but not used [-Werror=unused-but-set-variable]
  int  cmd;
       ^~~
../../common/io/usbgem/usbgem.c: In function 'usbgem_m_getstat':
../../common/io/usbgem/usbgem.c:4206:6: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
  int ret;
      ^~~
../../common/io/usbgem/usbgem.c: In function 'usbgem_m_tx':
../../common/io/usbgem/usbgem.c:4568:11: error: variable 'flags' set but not used [-Werror=unused-but-set-variable]
  uint32_t flags;
           ^~~~~


  • 0
  • 0
  • 2
  • 1
  • 3
Description From Last Updated
tsoome
andy_js
  1. 
      
  2. usr/src/uts/common/io/usbgem/usbgem.c (Diff revision 1)
     
     

    I would just replace cmd with iocp->ioc_cmd.

  3. usr/src/uts/common/io/usbgem/usbgem.c (Diff revision 1)
     
     

    Move the ifdef into the body of the if block and you can avoid using __unused.

  4. 
      
tsoome
andy_js
  1. 
      
  2. usr/src/uts/common/io/usbgem/usbgem.c (Diff revision 3)
     
     

    Since you've removed ret you can go ahead and move the ifdef back to where it was.

    1. I do not think so, we need to call usbgem_hal_get_stats(dp) anyhow because it may update the dp.

    2. Fair point. Clearly my morning coffee isn't strong enough.

  3. 
      
andy_js
  1. Ship It!
  2. 
      
rm
  1. Ship It!
  2. 
      
yuripv
  1. Ship It!
  2. 
      
tsoome
yuripv
  1. Ship It!
  2. 
      
rm
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...