Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH v1] Input: Drop unused assignments from pnp_device_id arrays
@ 2026-06-09 14:53 Uwe Kleine-König (The Capable Hub)
  2026-06-10  6:12 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-06-09 14:53 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Kees Cook, Werner Sembach, Christoffer Sandberg, feng, gongqi,
	linux-input, linux-kernel

Explicitly assigning .driver_data in drivers that don't use this member
is silly and a bit irritating. Drop these. Also simplify the list
terminator entry to be just empty to match what most other device_id
tables do.

There is no changed semantic, not even a change in the compiled result.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/input/gameport/ns558.c        | 46 +++++++++++-----------
 drivers/input/serio/i8042-acpipnpio.h | 56 +++++++++++++--------------
 2 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
index fdece6ec1df3..f70a96c4f1fd 100644
--- a/drivers/input/gameport/ns558.c
+++ b/drivers/input/gameport/ns558.c
@@ -148,29 +148,29 @@ static int ns558_isa_probe(int io)
 #ifdef CONFIG_PNP
 
 static const struct pnp_device_id pnp_devids[] = {
-	{ .id = "@P@0001", .driver_data = 0 }, /* ALS 100 */
-	{ .id = "@P@0020", .driver_data = 0 }, /* ALS 200 */
-	{ .id = "@P@1001", .driver_data = 0 }, /* ALS 100+ */
-	{ .id = "@P@2001", .driver_data = 0 }, /* ALS 120 */
-	{ .id = "ASB16fd", .driver_data = 0 }, /* AdLib NSC16 */
-	{ .id = "AZT3001", .driver_data = 0 }, /* AZT1008 */
-	{ .id = "CDC0001", .driver_data = 0 }, /* Opl3-SAx */
-	{ .id = "CSC0001", .driver_data = 0 }, /* CS4232 */
-	{ .id = "CSC000f", .driver_data = 0 }, /* CS4236 */
-	{ .id = "CSC0101", .driver_data = 0 }, /* CS4327 */
-	{ .id = "CTL7001", .driver_data = 0 }, /* SB16 */
-	{ .id = "CTL7002", .driver_data = 0 }, /* AWE64 */
-	{ .id = "CTL7005", .driver_data = 0 }, /* Vibra16 */
-	{ .id = "ENS2020", .driver_data = 0 }, /* SoundscapeVIVO */
-	{ .id = "ESS0001", .driver_data = 0 }, /* ES1869 */
-	{ .id = "ESS0005", .driver_data = 0 }, /* ES1878 */
-	{ .id = "ESS6880", .driver_data = 0 }, /* ES688 */
-	{ .id = "IBM0012", .driver_data = 0 }, /* CS4232 */
-	{ .id = "OPT0001", .driver_data = 0 }, /* OPTi Audio16 */
-	{ .id = "YMH0006", .driver_data = 0 }, /* Opl3-SA */
-	{ .id = "YMH0022", .driver_data = 0 }, /* Opl3-SAx */
-	{ .id = "PNPb02f", .driver_data = 0 }, /* Generic */
-	{ .id = "", },
+	{ .id = "@P@0001" }, /* ALS 100 */
+	{ .id = "@P@0020" }, /* ALS 200 */
+	{ .id = "@P@1001" }, /* ALS 100+ */
+	{ .id = "@P@2001" }, /* ALS 120 */
+	{ .id = "ASB16fd" }, /* AdLib NSC16 */
+	{ .id = "AZT3001" }, /* AZT1008 */
+	{ .id = "CDC0001" }, /* Opl3-SAx */
+	{ .id = "CSC0001" }, /* CS4232 */
+	{ .id = "CSC000f" }, /* CS4236 */
+	{ .id = "CSC0101" }, /* CS4327 */
+	{ .id = "CTL7001" }, /* SB16 */
+	{ .id = "CTL7002" }, /* AWE64 */
+	{ .id = "CTL7005" }, /* Vibra16 */
+	{ .id = "ENS2020" }, /* SoundscapeVIVO */
+	{ .id = "ESS0001" }, /* ES1869 */
+	{ .id = "ESS0005" }, /* ES1878 */
+	{ .id = "ESS6880" }, /* ES688 */
+	{ .id = "IBM0012" }, /* CS4232 */
+	{ .id = "OPT0001" }, /* OPTi Audio16 */
+	{ .id = "YMH0006" }, /* Opl3-SA */
+	{ .id = "YMH0022" }, /* Opl3-SAx */
+	{ .id = "PNPb02f" }, /* Generic */
+	{ }
 };
 
 MODULE_DEVICE_TABLE(pnp, pnp_devids);
diff --git a/drivers/input/serio/i8042-acpipnpio.h b/drivers/input/serio/i8042-acpipnpio.h
index 8ebdf4fb9030..412f82d7a303 100644
--- a/drivers/input/serio/i8042-acpipnpio.h
+++ b/drivers/input/serio/i8042-acpipnpio.h
@@ -1539,22 +1539,22 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *
 }
 
 static const struct pnp_device_id pnp_kbd_devids[] = {
-	{ .id = "PNP0300", .driver_data = 0 },
-	{ .id = "PNP0301", .driver_data = 0 },
-	{ .id = "PNP0302", .driver_data = 0 },
-	{ .id = "PNP0303", .driver_data = 0 },
-	{ .id = "PNP0304", .driver_data = 0 },
-	{ .id = "PNP0305", .driver_data = 0 },
-	{ .id = "PNP0306", .driver_data = 0 },
-	{ .id = "PNP0309", .driver_data = 0 },
-	{ .id = "PNP030a", .driver_data = 0 },
-	{ .id = "PNP030b", .driver_data = 0 },
-	{ .id = "PNP0320", .driver_data = 0 },
-	{ .id = "PNP0343", .driver_data = 0 },
-	{ .id = "PNP0344", .driver_data = 0 },
-	{ .id = "PNP0345", .driver_data = 0 },
-	{ .id = "CPQA0D7", .driver_data = 0 },
-	{ .id = "", },
+	{ .id = "PNP0300" },
+	{ .id = "PNP0301" },
+	{ .id = "PNP0302" },
+	{ .id = "PNP0303" },
+	{ .id = "PNP0304" },
+	{ .id = "PNP0305" },
+	{ .id = "PNP0306" },
+	{ .id = "PNP0309" },
+	{ .id = "PNP030a" },
+	{ .id = "PNP030b" },
+	{ .id = "PNP0320" },
+	{ .id = "PNP0343" },
+	{ .id = "PNP0344" },
+	{ .id = "PNP0345" },
+	{ .id = "CPQA0D7" },
+	{ }
 };
 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
 
@@ -1569,18 +1569,18 @@ static struct pnp_driver i8042_pnp_kbd_driver = {
 };
 
 static const struct pnp_device_id pnp_aux_devids[] = {
-	{ .id = "AUI0200", .driver_data = 0 },
-	{ .id = "FJC6000", .driver_data = 0 },
-	{ .id = "FJC6001", .driver_data = 0 },
-	{ .id = "PNP0f03", .driver_data = 0 },
-	{ .id = "PNP0f0b", .driver_data = 0 },
-	{ .id = "PNP0f0e", .driver_data = 0 },
-	{ .id = "PNP0f12", .driver_data = 0 },
-	{ .id = "PNP0f13", .driver_data = 0 },
-	{ .id = "PNP0f19", .driver_data = 0 },
-	{ .id = "PNP0f1c", .driver_data = 0 },
-	{ .id = "SYN0801", .driver_data = 0 },
-	{ .id = "", },
+	{ .id = "AUI0200" },
+	{ .id = "FJC6000" },
+	{ .id = "FJC6001" },
+	{ .id = "PNP0f03" },
+	{ .id = "PNP0f0b" },
+	{ .id = "PNP0f0e" },
+	{ .id = "PNP0f12" },
+	{ .id = "PNP0f13" },
+	{ .id = "PNP0f19" },
+	{ .id = "PNP0f1c" },
+	{ .id = "SYN0801" },
+	{ },
 };
 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
 

base-commit: a87737435cfa134f9cdcc696ba3080759d04cf72
-- 
2.47.3


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

* Re: [PATCH v1] Input: Drop unused assignments from pnp_device_id arrays
  2026-06-09 14:53 [PATCH v1] Input: Drop unused assignments from pnp_device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-06-10  6:12 ` Dmitry Torokhov
  2026-06-10 11:58   ` Uwe Kleine-König (The Capable Hub)
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2026-06-10  6:12 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub)
  Cc: Kees Cook, Werner Sembach, Christoffer Sandberg, feng, gongqi,
	linux-input, linux-kernel

Hi Uwe,

On Tue, Jun 09, 2026 at 04:53:25PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> Explicitly assigning .driver_data in drivers that don't use this member
> is silly and a bit irritating. Drop these. Also simplify the list
> terminator entry to be just empty to match what most other device_id
> tables do.
> 
> There is no changed semantic, not even a change in the compiled result.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> ---
>  drivers/input/gameport/ns558.c        | 46 +++++++++++-----------
>  drivers/input/serio/i8042-acpipnpio.h | 56 +++++++++++++--------------
>  2 files changed, 51 insertions(+), 51 deletions(-)
> 
> diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
> index fdece6ec1df3..f70a96c4f1fd 100644
> --- a/drivers/input/gameport/ns558.c
> +++ b/drivers/input/gameport/ns558.c
> @@ -148,29 +148,29 @@ static int ns558_isa_probe(int io)
>  #ifdef CONFIG_PNP
>  
>  static const struct pnp_device_id pnp_devids[] = {
> -	{ .id = "@P@0001", .driver_data = 0 }, /* ALS 100 */
> -	{ .id = "@P@0020", .driver_data = 0 }, /* ALS 200 */
> -	{ .id = "@P@1001", .driver_data = 0 }, /* ALS 100+ */
> -	{ .id = "@P@2001", .driver_data = 0 }, /* ALS 120 */
> -	{ .id = "ASB16fd", .driver_data = 0 }, /* AdLib NSC16 */
> -	{ .id = "AZT3001", .driver_data = 0 }, /* AZT1008 */
> -	{ .id = "CDC0001", .driver_data = 0 }, /* Opl3-SAx */
> -	{ .id = "CSC0001", .driver_data = 0 }, /* CS4232 */
> -	{ .id = "CSC000f", .driver_data = 0 }, /* CS4236 */
> -	{ .id = "CSC0101", .driver_data = 0 }, /* CS4327 */
> -	{ .id = "CTL7001", .driver_data = 0 }, /* SB16 */
> -	{ .id = "CTL7002", .driver_data = 0 }, /* AWE64 */
> -	{ .id = "CTL7005", .driver_data = 0 }, /* Vibra16 */
> -	{ .id = "ENS2020", .driver_data = 0 }, /* SoundscapeVIVO */
> -	{ .id = "ESS0001", .driver_data = 0 }, /* ES1869 */
> -	{ .id = "ESS0005", .driver_data = 0 }, /* ES1878 */
> -	{ .id = "ESS6880", .driver_data = 0 }, /* ES688 */
> -	{ .id = "IBM0012", .driver_data = 0 }, /* CS4232 */
> -	{ .id = "OPT0001", .driver_data = 0 }, /* OPTi Audio16 */
> -	{ .id = "YMH0006", .driver_data = 0 }, /* Opl3-SA */
> -	{ .id = "YMH0022", .driver_data = 0 }, /* Opl3-SAx */
> -	{ .id = "PNPb02f", .driver_data = 0 }, /* Generic */
> -	{ .id = "", },
> +	{ .id = "@P@0001" }, /* ALS 100 */
> +	{ .id = "@P@0020" }, /* ALS 200 */
> +	{ .id = "@P@1001" }, /* ALS 100+ */
> +	{ .id = "@P@2001" }, /* ALS 120 */
> +	{ .id = "ASB16fd" }, /* AdLib NSC16 */
> +	{ .id = "AZT3001" }, /* AZT1008 */
> +	{ .id = "CDC0001" }, /* Opl3-SAx */
> +	{ .id = "CSC0001" }, /* CS4232 */
> +	{ .id = "CSC000f" }, /* CS4236 */
> +	{ .id = "CSC0101" }, /* CS4327 */
> +	{ .id = "CTL7001" }, /* SB16 */
> +	{ .id = "CTL7002" }, /* AWE64 */
> +	{ .id = "CTL7005" }, /* Vibra16 */
> +	{ .id = "ENS2020" }, /* SoundscapeVIVO */
> +	{ .id = "ESS0001" }, /* ES1869 */
> +	{ .id = "ESS0005" }, /* ES1878 */
> +	{ .id = "ESS6880" }, /* ES688 */
> +	{ .id = "IBM0012" }, /* CS4232 */
> +	{ .id = "OPT0001" }, /* OPTi Audio16 */
> +	{ .id = "YMH0006" }, /* Opl3-SA */
> +	{ .id = "YMH0022" }, /* Opl3-SAx */
> +	{ .id = "PNPb02f" }, /* Generic */
> +	{ }

This goes BOOOM! You have to keep empty .id string as terminator.

Thanks.

-- 
Dmitry

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

* Re: [PATCH v1] Input: Drop unused assignments from pnp_device_id arrays
  2026-06-10  6:12 ` Dmitry Torokhov
@ 2026-06-10 11:58   ` Uwe Kleine-König (The Capable Hub)
  2026-06-10 16:57     ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-06-10 11:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Kees Cook, Werner Sembach, Christoffer Sandberg, feng, gongqi,
	linux-input, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]

Hello Dmitry,

On Tue, Jun 09, 2026 at 11:12:49PM -0700, Dmitry Torokhov wrote:
> On Tue, Jun 09, 2026 at 04:53:25PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > Explicitly assigning .driver_data in drivers that don't use this member
> > is silly and a bit irritating. Drop these. Also simplify the list
> > terminator entry to be just empty to match what most other device_id
> > tables do.
> > 
> > There is no changed semantic, not even a change in the compiled result.
> > 
> > Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> > ---
> >  drivers/input/gameport/ns558.c        | 46 +++++++++++-----------
> >  drivers/input/serio/i8042-acpipnpio.h | 56 +++++++++++++--------------
> >  2 files changed, 51 insertions(+), 51 deletions(-)
> > 
> > diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
> > index fdece6ec1df3..f70a96c4f1fd 100644
> > --- a/drivers/input/gameport/ns558.c
> > +++ b/drivers/input/gameport/ns558.c
> > @@ -148,29 +148,29 @@ static int ns558_isa_probe(int io)
> >  #ifdef CONFIG_PNP
> >  
> >  static const struct pnp_device_id pnp_devids[] = {
> > -   [...]
> > -	{ .id = "", },
> > +   [...]
> > +	{ }
> 
> This goes BOOOM! You have to keep empty .id string as terminator.

How so? Given that my patch doesn't modify the resulting ns558.o I doubt
that. If .id was a char *, I'd agree, but it's a char[], so there should
be no difference (and the compiler agrees).

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v1] Input: Drop unused assignments from pnp_device_id arrays
  2026-06-10 11:58   ` Uwe Kleine-König (The Capable Hub)
@ 2026-06-10 16:57     ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2026-06-10 16:57 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub)
  Cc: Kees Cook, Werner Sembach, Christoffer Sandberg, feng, gongqi,
	linux-input, linux-kernel

On Wed, Jun 10, 2026 at 01:58:17PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> Hello Dmitry,
> 
> On Tue, Jun 09, 2026 at 11:12:49PM -0700, Dmitry Torokhov wrote:
> > On Tue, Jun 09, 2026 at 04:53:25PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > > Explicitly assigning .driver_data in drivers that don't use this member
> > > is silly and a bit irritating. Drop these. Also simplify the list
> > > terminator entry to be just empty to match what most other device_id
> > > tables do.
> > > 
> > > There is no changed semantic, not even a change in the compiled result.
> > > 
> > > Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> > > ---
> > >  drivers/input/gameport/ns558.c        | 46 +++++++++++-----------
> > >  drivers/input/serio/i8042-acpipnpio.h | 56 +++++++++++++--------------
> > >  2 files changed, 51 insertions(+), 51 deletions(-)
> > > 
> > > diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
> > > index fdece6ec1df3..f70a96c4f1fd 100644
> > > --- a/drivers/input/gameport/ns558.c
> > > +++ b/drivers/input/gameport/ns558.c
> > > @@ -148,29 +148,29 @@ static int ns558_isa_probe(int io)
> > >  #ifdef CONFIG_PNP
> > >  
> > >  static const struct pnp_device_id pnp_devids[] = {
> > > -   [...]
> > > -	{ .id = "", },
> > > +   [...]
> > > +	{ }
> > 
> > This goes BOOOM! You have to keep empty .id string as terminator.
> 
> How so? Given that my patch doesn't modify the resulting ns558.o I doubt
> that. If .id was a char *, I'd agree, but it's a char[], so there should
> be no difference (and the compiler agrees).

Sorry, brain fart on my part.

Applied, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2026-06-10 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 14:53 [PATCH v1] Input: Drop unused assignments from pnp_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-06-10  6:12 ` Dmitry Torokhov
2026-06-10 11:58   ` Uwe Kleine-König (The Capable Hub)
2026-06-10 16:57     ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox