Skip to contentSkip to conversation

staging: gpib: Declare processor directive as CONFIG_TNT4882

PATCH In review Gopi 3 participants 4 messages Sep 9, 2025 3 messages not in the archive Staging

lore
Share & tools
lore

Gopi

author
#0 lore raw

PATCH 1/1 staging: gpib: Declare processor directive as CONFIG_TNT4882

Warning massage found by checkpatch.pl script.

---
 drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gpib/tnt4882/tnt4882_gpib.c +1 -1
index a17b69e34986..918a4cebbc6c 100644
@@ -1369,7 +1369,7 @@ static struct pci_driver tnt4882_pci_driver = {
 	.probe = &tnt4882_pci_probe
 };
 
-#if 0
+#ifdef CONFIG_TNT4882
 /* unused, will be needed when the driver is turned into a pnp_driver */
 static const struct pnp_device_id tnt4882_pnp_table[] = {
 	{.id = "NICC601"},
Signature · 1 line
2.25.1
#1 lore raw
Quoted 12 lines · Gopi

Warning massage found by checkpatch.pl script.

---
 drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gpib/tnt4882/tnt4882_gpib.c +0 -0
index a17b69e34986..918a4cebbc6c 100644

drivers/staging/gpib/tnt4882/tnt4882_gpib.c static struct pci_driver tnt4882_pci_driver = { · line 1372

Quoted 5 lines
drivers/staging/gpib/tnt4882/tnt4882_gpib.c +1 -1
@@ -1369,7 +1369,7 @@ static struct pci_driver tnt4882_pci_driver = {
 	.probe = &tnt4882_pci_probe
 };
 
-#if 0
+#ifdef CONFIG_TNT4882

I do not understand, sorry, why is this the correct value to put here?

drivers/staging/gpib/tnt4882/tnt4882_gpib.c static struct pci_driver tnt4882_pci_driver = { · line 1375

Quoted 3 lines
drivers/staging/gpib/tnt4882/tnt4882_gpib.c +0 -0
 /* unused, will be needed when the driver is turned into a pnp_driver */
 static const struct pnp_device_id tnt4882_pnp_table[] = {
 	{.id = "NICC601"},

Now the code will not be unused, as you just enabled it? Are you sure the checkpatch warning was correct?

thanks,

greg k-h

A message that is not in the archive (sent off-list or not yet received): CAGt2Sa+MriEYjPOFGmKWuHXabwkJeWn7q9o8U14B7o3QY4xmyg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): 2025090945-ecologist-gravel-d028@gregkh

A message that is not in the archive (sent off-list or not yet received): CAGt2Sa+tKAmxspYX=iyihmZYxWg0=xOJPW+J0h=9rTG8E99AAg@mail.gmail.com

#5 lore raw
Quoted 5 lines · GOPI JEGANATHAN

Hi Greg

I just saw the warning message in Checkpatch.pl file. It's says #if 0 is something wrong so I just change the processor directives properly using #ifdef CONFIG_TNT4882, Is that change is wrong!?

#if 0 is a way to comment out code, you just enabled that code to now be present. That's probably not the correct thing for this driver, right? The whole thing is already using CONFIG_TNT4882, so declaring it again would be the same as just removing the #if 0 line.

In short, only change this type of thing either by removing the code entirely, or figuring out why it's still present and then fixing it up to actually be used and remove the #if 0 lines.

thanks,

greg k-h

#6 lore raw
Quoted 12 lines · Greg Kroah-Hartman
Quoted 5 lines · GOPI JEGANATHAN

Hi Greg

I just saw the warning message in Checkpatch.pl file. It's says #if 0 is something wrong so I just change the processor directives properly using #ifdef CONFIG_TNT4882, Is that change is wrong!?

#if 0 is a way to comment out code, you just enabled that code to now be present. That's probably not the correct thing for this driver, right? The whole thing is already using CONFIG_TNT4882, so declaring it again would be the same as just removing the #if 0 line.

Quoted 7 lines

In short, only change this type of thing either by removing the code entirely, or figuring out why it's still present and then fixing it up to actually be used and remove the #if 0 lines.

thanks,

greg k-h

The code in the #if 0 scope in question can be removed entirely. There is no call to make the driver it into a pnp driver. cheers,
-dave