linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usbip: tools: remove duplicate "daemon" entry in longopts
@ 2026-08-18  2:15 longlong yan
  2026-09-22 15:16 ` Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: longlong yan @ 2026-08-18  2:15 UTC (permalink / raw)
  To: linux-usb; +Cc: valentina.manea.m, shuah, skhan, i, longlong yan

The longopts array in main() contains two identical entries for the
"daemon" option. This is a harmless redundancy since getopt_long()
uses the first match, but it is dead code that can confuse readers.

The duplicate was introduced when the long options list was
reformatted for alignment.

Fixes: 92e11aef70fb ("staging: usbip: fix up alignment in long options list")
Signed-off-by: longlong yan <yanlonglong@kylinos.cn>
---
 tools/usb/usbip/src/usbipd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/usb/usbip/src/usbipd.c b/tools/usb/usbip/src/usbipd.c
index 3e22b651c754..00904508db67 100644
--- a/tools/usb/usbip/src/usbipd.c
+++ b/tools/usb/usbip/src/usbipd.c
@@ -589,7 +589,6 @@ int main(int argc, char *argv[])
 		{ "ipv4",     no_argument,       NULL, '4' },
 		{ "ipv6",     no_argument,       NULL, '6' },
 		{ "daemon",   no_argument,       NULL, 'D' },
-		{ "daemon",   no_argument,       NULL, 'D' },
 		{ "debug",    no_argument,       NULL, 'd' },
 		{ "device",   no_argument,       NULL, 'e' },
 		{ "pid",      optional_argument, NULL, 'P' },
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usbip: tools: remove duplicate "daemon" entry in longopts
  2026-08-18  2:15 [PATCH] usbip: tools: remove duplicate "daemon" entry in longopts longlong yan
@ 2026-09-22 15:16 ` Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2026-09-22 15:16 UTC (permalink / raw)
  To: longlong yan, linux-usb; +Cc: valentina.manea.m, shuah, i, Shuah Khan

On 8/17/26 20:15, longlong yan wrote:
> The longopts array in main() contains two identical entries for the
> "daemon" option. This is a harmless redundancy since getopt_long()
> uses the first match, but it is dead code that can confuse readers.
> 
> The duplicate was introduced when the long options list was
> reformatted for alignment.
> 
> Fixes: 92e11aef70fb ("staging: usbip: fix up alignment in long options list")
> Signed-off-by: longlong yan <yanlonglong@kylinos.cn>
> ---
>   tools/usb/usbip/src/usbipd.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/tools/usb/usbip/src/usbipd.c b/tools/usb/usbip/src/usbipd.c
> index 3e22b651c754..00904508db67 100644
> --- a/tools/usb/usbip/src/usbipd.c
> +++ b/tools/usb/usbip/src/usbipd.c
> @@ -589,7 +589,6 @@ int main(int argc, char *argv[])
>   		{ "ipv4",     no_argument,       NULL, '4' },
>   		{ "ipv6",     no_argument,       NULL, '6' },
>   		{ "daemon",   no_argument,       NULL, 'D' },
> -		{ "daemon",   no_argument,       NULL, 'D' },

It is a good find.

How did you find this problem? What kind of testing was done on this
change?


>   		{ "debug",    no_argument,       NULL, 'd' },
>   		{ "device",   no_argument,       NULL, 'e' },
>   		{ "pid",      optional_argument, NULL, 'P' },

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-22 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18  2:15 [PATCH] usbip: tools: remove duplicate "daemon" entry in longopts longlong yan
2026-09-22 15:16 ` Shuah Khan

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).