* [PATCH] USBIP: Use fallthrough pseudo-keyword
@ 2024-02-15 9:26 Pairman Guo
2024-02-15 10:14 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Pairman Guo @ 2024-02-15 9:26 UTC (permalink / raw)
To: valentina.manea.m, shuah; +Cc: linux-usb, linux-kernel, Pairman Guo
Hi maintainers,
There is a usage of ``/* FALLTHRU */`` in a switch statement in main()
that have long been untouched. This patch replaced it with the
better and proper pseudo-keyword ``fallthrough;``.
Please merge if it is the case. Thank you in advance.
Signed-off-by: Pairman Guo <pairmanxlr@gmail.com>
---
tools/usb/usbip/src/usbip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/usb/usbip/src/usbip.c b/tools/usb/usbip/src/usbip.c
index f7c7220d9..ddcafb5c7 100644
--- a/tools/usb/usbip/src/usbip.c
+++ b/tools/usb/usbip/src/usbip.c
@@ -165,7 +165,7 @@ int main(int argc, char *argv[])
case '?':
printf("usbip: invalid option\n");
/* Terminate after printing error */
- /* FALLTHRU */
+ fallthrough;
default:
usbip_usage();
goto out;
--
2.43.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] USBIP: Use fallthrough pseudo-keyword
2024-02-15 9:26 [PATCH] USBIP: Use fallthrough pseudo-keyword Pairman Guo
@ 2024-02-15 10:14 ` Greg KH
2024-02-16 7:55 ` Pairman Guo
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2024-02-15 10:14 UTC (permalink / raw)
To: Pairman Guo; +Cc: valentina.manea.m, shuah, linux-usb, linux-kernel
On Thu, Feb 15, 2024 at 05:26:30PM +0800, Pairman Guo wrote:
> Hi maintainers,
>
> There is a usage of ``/* FALLTHRU */`` in a switch statement in main()
> that have long been untouched. This patch replaced it with the
> better and proper pseudo-keyword ``fallthrough;``.
>
> Please merge if it is the case. Thank you in advance.
This is not needed in a changelog text.
> Signed-off-by: Pairman Guo <pairmanxlr@gmail.com>
> ---
> tools/usb/usbip/src/usbip.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/usb/usbip/src/usbip.c b/tools/usb/usbip/src/usbip.c
> index f7c7220d9..ddcafb5c7 100644
> --- a/tools/usb/usbip/src/usbip.c
> +++ b/tools/usb/usbip/src/usbip.c
> @@ -165,7 +165,7 @@ int main(int argc, char *argv[])
> case '?':
> printf("usbip: invalid option\n");
> /* Terminate after printing error */
> - /* FALLTHRU */
> + fallthrough;
Did you compile this? This is userspace code, and as-such, I don't
think it has this keyword, does it?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Re: [PATCH] USBIP: Use fallthrough pseudo-keyword
2024-02-15 10:14 ` Greg KH
@ 2024-02-16 7:55 ` Pairman Guo
0 siblings, 0 replies; 3+ messages in thread
From: Pairman Guo @ 2024-02-16 7:55 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-usb, pairmanxlr, shuah, valentina.manea.m
On Thu, Feb 15, 2024 at 11:14:49 +0800, Greg KH wrote:
> This is not needed in a changelog text.
Thanks for telling. I'm new to lkml and still learning about the format.
> > tools/usb/usbip/src/usbip.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/usb/usbip/src/usbip.c b/tools/usb/usbip/src/usbip.c
> > index f7c7220d9..ddcafb5c7 100644
> > --- a/tools/usb/usbip/src/usbip.c
> > +++ b/tools/usb/usbip/src/usbip.c
> > @@ -165,7 +165,7 @@ int main(int argc, char *argv[])
> > case '?':
> > printf("usbip: invalid option\n");
> > /* Terminate after printing error */
> > - /* FALLTHRU */
> > + fallthrough;
>
> Did you compile this? This is userspace code, and as-such, I don't
> think it has this keyword, does it?
I'm sorry for my hurrying. I ran ``make tools/usb`` with no warning or error,
so I sent this patch. Now it turns out ``make tools/usb`` doesn't cover
tools/usb/usbip. I tried again with ``./autogen.sh && ./configure && make``
and it indeed failed. Since usbip.c doesn't have any reference to
include/linux/compiler.h, it cannot use ``fallthrough``. Thanks again for
pointing out this error.
Thanks,
Pairman
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-16 7:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-15 9:26 [PATCH] USBIP: Use fallthrough pseudo-keyword Pairman Guo
2024-02-15 10:14 ` Greg KH
2024-02-16 7:55 ` Pairman Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).