8814 nxge: variable 'ether_class' set but not used

Review Request #741 — Created Nov. 19, 2017 and submitted

tsoome
illumos-gate
8814
e69b405...
general
../../common/io/nxge/nxge_ndd.c:1755:11: error: variable 'ether_class' set but not used [-Werror=unused-but-set-variable]
  uint8_t  ether_class;
           ^~~~~~~~~~~
cc1: all warnings being treated as errors


yuripv
  1. That's pretty weird one -- that entire function looks like a no-op, missing actual call to set the parameter.

  2. 
      
jgmills
  1. It would be safer to just do this:
    
    	if (cfg_it == B_TRUE) {
                    (void) mi_strtol(pa->name, &end, 10);
    		NXGE_DEBUG_MSG((nxgep, NDD_CTL, " nxge_param_set_ether_usr"));
    	}
    
    The second parameter is an output parameter as well.  However, it's also not used.
    
    The `10' should be changed to `BASE_DECIMAL', I suppose.
    1. Yes, since it is not used in later code, that whole call is not needed (and the end is local variable) and I see no reason to keep it. I only hope that someone with hardware for nxge will eventually fix this code.

    2. Ok, so if we drop useless mi_strtol() we need to suppress lint or remove this entire if (), or we keep mi_strtol() and do not have to deal with lint. Lets keep it and hopefully someone with hardware will implement the actual hw setup...

  2. 
      
tsoome
jgmills
  1. Okay, I'm happy with those changes.

  2. 
      
yuripv
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...