Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] EDAC: use NULL instead of using plain integer as pointer
@ 2021-03-17  7:47 Yang Li
  2021-03-17 11:33 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-03-17  7:47 UTC (permalink / raw)
  To: tony.luck
  Cc: qiuxu.zhuo, bp, mchehab, james.morse, rric, linux-edac,
	linux-kernel, 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

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/edac/sb_edac.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 93daa42..a99df55 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -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. */
 };
 
 
-- 
1.8.3.1


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

* Re: [PATCH] EDAC: use NULL instead of using plain integer as pointer
  2021-03-17  7:47 [PATCH] EDAC: use NULL instead of using plain integer as pointer Yang Li
@ 2021-03-17 11:33 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2021-03-17 11:33 UTC (permalink / raw)
  To: Yang Li
  Cc: tony.luck, qiuxu.zhuo, mchehab, james.morse, rric, linux-edac,
	linux-kernel

On Wed, Mar 17, 2021 at 03:47:25PM +0800, Yang Li wrote:
> 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
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  drivers/edac/sb_edac.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
> index 93daa42..a99df55 100644
> --- a/drivers/edac/sb_edac.c
> +++ b/drivers/edac/sb_edac.c
> @@ -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?

-- 
Regards/Gruss,
    Boris.

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

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17  7:47 [PATCH] EDAC: use NULL instead of using plain integer as pointer Yang Li
2021-03-17 11:33 ` Borislav Petkov

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org
	public-inbox-index linux-edac

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git