lkml.org 
[lkml]   [2019]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] can: mark expected switch fall-throughs
    From
    Date


    On 2/26/19 2:02 AM, Marc Kleine-Budde wrote:
    > On 1/29/19 7:06 PM, Gustavo A. R. Silva wrote:
    >> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
    >> where we are expecting to fall through.
    >>
    >> This patch fixes the following warnings:
    >>
    >> drivers/net/can/peak_canfd/peak_pciefd_main.c:668:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
    >> drivers/net/can/spi/mcp251x.c:875:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    >> drivers/net/can/usb/peak_usb/pcan_usb.c:422:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    >> drivers/net/can/at91_can.c:895:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    >> drivers/net/can/at91_can.c:953:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
    >> drivers/net/can/usb/peak_usb/pcan_usb.c: In function ‘pcan_usb_decode_error’:
    >> drivers/net/can/usb/peak_usb/pcan_usb.c:422:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    >> if (n & PCAN_USB_ERROR_BUS_LIGHT) {
    >> ^
    >> drivers/net/can/usb/peak_usb/pcan_usb.c:428:2: note: here
    >> case CAN_STATE_ERROR_WARNING:
    >> ^~~~
    >>
    >> Warning level 3 was used: -Wimplicit-fallthrough=3
    >>
    >> This patch is part of the ongoing efforts to enabling
    >> -Wimplicit-fallthrough.
    >>
    >> Notice that in some cases spelling mistakes were fixed.
    >> In other cases, the /* fall through */ comment is placed
    >> at the bottom of the case statement, which is what GCC
    >> is expecting to find.
    >>
    >> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
    >
    > Added to linux-can-next.
    >

    Thanks, Marc.

    --
    Gustavo

    \
     
     \ /
      Last update: 2019-02-26 16:41    [W:9.051 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site