diff options
author | Tom Rix <trix@redhat.com> | 2020-09-07 08:32:25 -0700 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2020-09-08 14:56:17 -0700 |
commit | fbd4ab780284aeb66374223fa3ac0cd47611aebe (patch) | |
tree | 3a30924c95edc2c876179756497d353be888eb59 /drivers/edac | |
parent | 66077adb70a2a9e92540155b2ace33ec98299c90 (diff) | |
download | linux-stable-fbd4ab780284aeb66374223fa3ac0cd47611aebe.tar.gz linux-stable-fbd4ab780284aeb66374223fa3ac0cd47611aebe.tar.bz2 linux-stable-fbd4ab780284aeb66374223fa3ac0cd47611aebe.zip |
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
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/sb_edac.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index a6704e73fcce..9a0d53f44baa 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c @@ -939,12 +939,9 @@ static enum dev_type sbridge_get_width(struct sbridge_pvt *pvt, u32 mtr) static enum dev_type __ibridge_get_width(u32 mtr) { - enum dev_type type; + enum dev_type type = DEV_UNKNOWN; switch (mtr) { - case 3: - type = DEV_UNKNOWN; - break; case 2: type = DEV_X16; break; |