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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250309163322.331b6a36@jic23-huawei>
Date: Sun, 9 Mar 2025 16:33:22 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: David Heidelberg via B4 Relay <devnull+david.ixit.cz@...nel.org>
Cc: david@...t.cz, Lars-Peter Clausen <lars@...afoo.de>, Svyatoslav Ryhel
 <clamor95@...il.com>, Robert Eckelmann <longnoserob@...il.com>,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] iio: light: al3000a: Use DRV_NAME

On Sat, 08 Mar 2025 21:00:59 +0100
David Heidelberg via B4 Relay <devnull+david.ixit.cz@...nel.org> wrote:

> From: David Heidelberg <david@...t.cz>
> 
> Sync syntax with other similar drivers.

Sorry no. This is a syntax I am against and frequently request people to not
use in drivers.

The  main reason is there is no explicit reason the two locations you use it
in here should use the same string.  Using a define makes that implication
and I'd prefer that we did not.  Note that if they were required to be the
same then a define would make sense.

I want to look at the code and see the string directly in these locations
rather than go look for a define that adds nothing.

Jonathan




> 
> Signed-off-by: David Heidelberg <david@...t.cz>
> ---
>  drivers/iio/light/al3000a.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/light/al3000a.c b/drivers/iio/light/al3000a.c
> index e2fbb1270040f43d9f0a97838861818a8eaef813..e1fa4543f336cec61140b5c44d3794df1fa485cd 100644
> --- a/drivers/iio/light/al3000a.c
> +++ b/drivers/iio/light/al3000a.c
> @@ -13,6 +13,8 @@
>  
>  #include <linux/iio/iio.h>
>  
> +#define AL3000A_DRV_NAME "al3000a"
> +
>  #define AL3000A_REG_SYSTEM		0x00
>  #define AL3000A_REG_DATA		0x05
>  
> @@ -148,7 +150,7 @@ static int al3000a_probe(struct i2c_client *client)
>  				     "failed to get vdd regulator\n");
>  
>  	indio_dev->info = &al3000a_info;
> -	indio_dev->name = "al3000a";
> +	indio_dev->name = AL3000A_DRV_NAME;
>  	indio_dev->channels = al3000a_channels;
>  	indio_dev->num_channels = ARRAY_SIZE(al3000a_channels);
>  	indio_dev->modes = INDIO_DIRECT_MODE;
> @@ -195,7 +197,7 @@ MODULE_DEVICE_TABLE(of, al3000a_of_match);
>  
>  static struct i2c_driver al3000a_driver = {
>  	.driver = {
> -		.name = "al3000a",
> +		.name = AL3000A_DRV_NAME,
>  		.of_match_table = al3000a_of_match,
>  		.pm = pm_sleep_ptr(&al3000a_pm_ops),
>  	},
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ