]> git.openfabrics.org - ~emulex/infiniband.git/commit
e1000e: fix compiler warning (maybe-unitialized variable)
authorDavid Ertman <davidx.m.ertman@intel.com>
Sat, 14 Dec 2013 07:30:39 +0000 (07:30 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 18 Dec 2013 06:20:49 +0000 (22:20 -0800)
commit918a4308bad24a8c40a9e569fb7b3a6295ec7757
treee0395fed40bf9059037f10cb7d769c4f586f3586
parent9e6c3b63399dd424d33a34e08b77f2cab0b84cdc
e1000e: fix compiler warning (maybe-unitialized variable)

This patch is to fix a compiler warning of maybe-uininitialized-variable
that is generated from gcc when the -O3 flag is used.  In the function
e1000_reset_hw_80003es2lan(), the variable krmn_reg_data is first given
a value by being passed to a register read function as a
pass-by-reference parameter.  But, the return value of that read
function was never checked to see if the read failed and the variable
not given an initial value.  The compiler was smart enough to spot
this.  This patch is to check the return value for that read function
and return it, if an error occurs, without trying to utilize the value
in kmrn_reg_data.

Signed-off-by: David Ertman <davidx.m.ertman@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000e/80003es2lan.c