[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91eef5ab3143ae8fadb8eb2969aecba5f3e7ad98.camel@perches.com>
Date: Mon, 07 Jun 2021 15:02:40 -0700
From: Joe Perches <joe@...ches.com>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org, Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH][next] Input: Fix fall-through warning for Clang
On Mon, 2021-06-07 at 16:48 -0500, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a
> warning by explicitly adding a fallthrough; statement.
[]
> diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
[]
> @@ -660,6 +660,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
> fallthrough;
> case 45: /* Ambiguous packet length */
> if (j <= 40) { /* ID length less or eq 40 -> FSP */
> + fallthrough;
> case 43:
> sw->type = SW_ID_FSP;
> break;
Yuck. Super ugly. There's no need to play games with indentation.
Perhaps the simpler:
case 43:
sw->type = SW_ID_FSP;
break;
case 45: /* Ambiguous packet length */
if (j <= 40) { /* ID length less or eq 40 -> FSP */
sw->type = SW_ID_FSP;
break;
}
sw->number++;
fallthrough;
Powered by blists - more mailing lists