Skip to contentSkip to conversation

USBIP: Use fallthrough pseudo-keyword

PATCH In review Pairman Guo 2 participants 3 messages Feb 15, 2024 – Feb 16, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USBIP: Use fallthrough pseudo-keyword

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.

---
 tools/usb/usbip/src/usbip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/usb/usbip/src/usbip.c +1 -1
index f7c7220d9..ddcafb5c7 100644
@@ -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;
Signature · 1 line
2.43.1
maintainer
#1 lore raw
Quoted 7 lines · 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.

This is not needed in a changelog text.

Quoted 10 lines
---
 tools/usb/usbip/src/usbip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/usb/usbip/src/usbip.c +0 -0
index f7c7220d9..ddcafb5c7 100644

tools/usb/usbip/src/usbip.c int main(int argc, char *argv[]) · line 168

Quoted 5 lines
tools/usb/usbip/src/usbip.c +1 -1
@@ -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

#2 lore raw
Quoted 1 line · Greg KH

This is not needed in a changelog text.

Thanks for telling. I'm new to lkml and still learning about the format.

Quoted 16 lines

tools/usb/usbip/src/usbip.c int main(int argc, char *argv[]) · line 168

Quoted 13 lines
 tools/usb/usbip/src/usbip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/usb/usbip/src/usbip.c +1 -1
index f7c7220d9..ddcafb5c7 100644
@@ -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