• Gustavo A. R. Silva's avatar
    mtd: cfi_util: mark expected switch fall-throughs · 660e1716
    Gustavo A. R. Silva authored
    In preparation to enabling -Wimplicit-fallthrough, mark switch
    cases where we are expecting to fall through.
    
    This patch fixes the following warnings:
    
    drivers/mtd/chips/cfi_util.c: In function ‘cfi_build_cmd’:
    drivers/mtd/chips/cfi_util.c:110:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
       onecmd |= (onecmd << (chip_mode * 32));
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/chips/cfi_util.c:112:2: note: here
      case 4:
      ^~~~
    drivers/mtd/chips/cfi_util.c:113:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
       onecmd |= (onecmd << (chip_mode * 16));
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/chips/cfi_util.c:114:2: note: here
      case 2:
      ^~~~
    drivers/mtd/chips/cfi_util.c: In function ‘cfi_merge_status’:
    drivers/mtd/chips/cfi_util.c:163:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
       res |= (onestat >> (chip_mode * 32));
       ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/chips/cfi_util.c:165:2: note: here
      case 4:
      ^~~~
    drivers/mtd/chips/cfi_util.c:166:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
       res |= (onestat >> (chip_mode * 16));
       ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/chips/cfi_util.c:167:2: note: here
      case 2:
      ^~~~
    
    Warning level 3 was used: -Wimplicit-fallthrough=3
    
    This patch is part of the ongoing efforts to enabling
    -Wimplicit-fallthrough.
    Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
    Reviewed-by: default avatarKees Cook <keescook@chromium.org>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    660e1716
cfi_util.c 11.3 KB