Skip to contentSkip to conversation

EDAC: use NULL instead of using plain integer as pointer

PATCH In review Yang Li 2 participants 2 messages Mar 17, 2021

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 EDAC: use NULL instead of using plain integer as pointer

This fixes the following sparse warnings:
drivers/edac/sb_edac.c:433:10: warning: Using plain integer as NULL pointer
drivers/edac/sb_edac.c:499:10: warning: Using plain integer as NULL pointer
drivers/edac/sb_edac.c:570:10: warning: Using plain integer as NULL pointer
drivers/edac/sb_edac.c:614:10: warning: Using plain integer as NULL pointer
drivers/edac/sb_edac.c:680:10: warning: Using plain integer as NULL pointer

---
 drivers/edac/sb_edac.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/edac/sb_edac.c +5 -5
index 93daa42..a99df55 100644
@@ -433,7 +433,7 @@ struct sbridge_pvt {
 
 static const struct pci_id_table pci_dev_descr_sbridge_table[] = {
 	PCI_ID_TABLE_ENTRY(pci_dev_descr_sbridge, ARRAY_SIZE(pci_dev_descr_sbridge), 1, SANDY_BRIDGE),
-	{0,}			/* 0 terminated list. */
+	{NULL,}			/* 0 terminated list. */
 };
 
 /* This changes depending if 1HA or 2HA:
@@ -499,7 +499,7 @@ struct sbridge_pvt {
 
 static const struct pci_id_table pci_dev_descr_ibridge_table[] = {
 	PCI_ID_TABLE_ENTRY(pci_dev_descr_ibridge, 12, 2, IVY_BRIDGE),
-	{0,}			/* 0 terminated list. */
+	{NULL,}			/* 0 terminated list. */
 };
 
 /* Haswell support */
@@ -570,7 +570,7 @@ struct sbridge_pvt {
 
 static const struct pci_id_table pci_dev_descr_haswell_table[] = {
 	PCI_ID_TABLE_ENTRY(pci_dev_descr_haswell, 13, 2, HASWELL),
-	{0,}			/* 0 terminated list. */
+	{NULL,}			/* 0 terminated list. */
 };
 
 /* Knight's Landing Support */
@@ -614,7 +614,7 @@ struct sbridge_pvt {
 
 static const struct pci_id_table pci_dev_descr_knl_table[] = {
 	PCI_ID_TABLE_ENTRY(pci_dev_descr_knl, ARRAY_SIZE(pci_dev_descr_knl), 1, KNIGHTS_LANDING),
-	{0,}
+	{NULL,}
 };
 
 /*
@@ -680,7 +680,7 @@ struct sbridge_pvt {
 
 static const struct pci_id_table pci_dev_descr_broadwell_table[] = {
 	PCI_ID_TABLE_ENTRY(pci_dev_descr_broadwell, 10, 2, BROADWELL),
-	{0,}			/* 0 terminated list. */
+	{NULL,}			/* 0 terminated list. */
 };
 
 
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 23 lines · Yang Li

This fixes the following sparse warnings:
drivers/edac/sb_edac.c:433:10: warning: Using plain integer as NULL pointer
drivers/edac/sb_edac.c:499:10: warning: Using plain integer as NULL pointer
drivers/edac/sb_edac.c:570:10: warning: Using plain integer as NULL pointer
drivers/edac/sb_edac.c:614:10: warning: Using plain integer as NULL pointer
drivers/edac/sb_edac.c:680:10: warning: Using plain integer as NULL pointer

---
 drivers/edac/sb_edac.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/edac/sb_edac.c +0 -0
index 93daa42..a99df55 100644

drivers/edac/sb_edac.c struct sbridge_pvt { · line 436

Quoted 5 lines
drivers/edac/sb_edac.c +1 -1
@@ -433,7 +433,7 @@ struct sbridge_pvt {
 
 static const struct pci_id_table pci_dev_descr_sbridge_table[] = {
 	PCI_ID_TABLE_ENTRY(pci_dev_descr_sbridge, ARRAY_SIZE(pci_dev_descr_sbridge), 1, SANDY_BRIDGE),
-	{0,}			/* 0 terminated list. */
+	{NULL,}			/* 0 terminated list. */

Why does this matter for list terminators?

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette