diff options
author | Abhinav Singh <singhabhinav9051571833@gmail.com> | 2023-11-28 17:17:03 +0300 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2023-11-28 17:43:43 +0300 |
commit | a2f99fbae4513ce4871e71ba88cd9d75fe5019e6 (patch) | |
tree | ae8590d7bcc9871cda6e7b7768515939524451f4 /drivers/edac/i7core_edac.c | |
parent | 9e08ac1b5e3bb7837aa23b67a97f08b80384e9d2 (diff) | |
download | linux-a2f99fbae4513ce4871e71ba88cd9d75fe5019e6.tar.xz |
EDAC/{sb,i7core}_edac: Do not use a plain integer for a NULL pointer
Sparse warns about the use of the integer constant 0 as a NULL pointer
with the -Wnon-pointer-null switch.
Even though the C standard requires that 0 == NULL and type conversion
rules turn an integer constant 0 into a NULL pointer when cast to a void
* type, Linus notes that this is a very poor situation from a type
safety angle and a pointer should be initialized with a pointer type
- not an integer constant.
See https://www.spinics.net/lists/linux-sparse/msg10066.html for more
info.
[ bp: Rewrite commit message, drop useless comments in the code. ]
Signed-off-by: Abhinav Singh <singhabhinav9051571833@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231128141703.614605-1-singhabhinav9051571833@gmail.com
Diffstat (limited to 'drivers/edac/i7core_edac.c')
-rw-r--r-- | drivers/edac/i7core_edac.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 23d25724bae4..91e0a88ef904 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -376,7 +376,7 @@ static const struct pci_id_table pci_dev_table[] = { PCI_ID_TABLE_ENTRY(pci_dev_descr_i7core_nehalem), PCI_ID_TABLE_ENTRY(pci_dev_descr_lynnfield), PCI_ID_TABLE_ENTRY(pci_dev_descr_i7core_westmere), - {0,} /* 0 terminated list. */ + { NULL, } }; /* @@ -385,7 +385,7 @@ static const struct pci_id_table pci_dev_table[] = { static const struct pci_device_id i7core_pci_tbl[] = { {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_X58_HUB_MGMT)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNNFIELD_QPI_LINK0)}, - {0,} /* 0 terminated list. */ + { 0, } }; /**************************************************************************** |