]> git.baikalelectronics.ru Git - kernel.git/commit
EDAC, sb_edac: Simplify switch statement
authorTom Rix <trix@redhat.com>
Mon, 7 Sep 2020 15:32:25 +0000 (08:32 -0700)
committerTony Luck <tony.luck@intel.com>
Tue, 8 Sep 2020 21:56:17 +0000 (14:56 -0700)
commit439f511c6c927909db498319bb10a1166ad70b0c
tree3a30924c95edc2c876179756497d353be888eb59
parent2455c5982df8a48ec90a3bfa92f5248f0667ec58
EDAC, sb_edac: Simplify switch statement

clang static analyzer reports this problem

sb_edac.c:959:2: warning: Undefined or garbage value
  returned to caller
        return type;
        ^~~~~~~~~~~

This is a false positive.

However by initializing the type to DEV_UNKNOWN the 3 case can be
removed from the switch, saving a comparison and jump.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20200907153225.7294-1-trix@redhat.com
drivers/edac/sb_edac.c