lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANDhNCqzTM4RMp2EEUp_cGTHhorDC3eNh+N9N0VL1KeL-xKq+A@mail.gmail.com>
Date: Wed, 13 Aug 2025 21:12:03 -0700
From: John Stultz <jstultz@...gle.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Arnd Bergmann <arnd@...db.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] misc: hisi_hikey_usb: Use str_enabled_disabled() in hub_power_ctrl()

On Wed, Aug 13, 2025 at 11:01 AM Thorsten Blum <thorsten.blum@...ux.dev> wrote:
>
> Remove hard-coded strings by using the str_enabled_disabled() helper
> function and silence the following Coccinelle/coccicheck warning
> reported by string_choices.cocci:
>
>   opportunity for str_enabled_disabled(value)

Thanks for submitting this!

So "silence a warning" isn't really a great argument for *why* this is
being done.

I wasn't actually familiar with str_enabled_disabled, and initially
this change felt a bit arbitrary: The length of the function name
barely saves code characters - and it only seems to make the logic a
little less readable - so what is the point?

But after digging around it seems the benefit comes from allowing the
"enabled" and "disabled" string constants to be consolidated across
numerous uses. Which saves memory and makes sense.

So it might be good to add some detail in the commit message about
that, just so it's clear why this change is helpful.

Otherwise,
Acked-by: John Stultz <jstultz@...gle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ