2009-03-05 19:12:50

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 00/15] NULL noise fix: allmodconfig (x86_64), entire tree

The following series does a minor aka. trivial thing, i.e. fixes 'NULL
noise' for allmodconfig (x86_64) for the entire tree.

---
Hannes Eder (15):
NULL noise: mm/memcontrol.c
NULL noise: kernel/test_kprobes.c
NULL noise: fs/reiserfs/inode.c
NULL noise: fs/super.c
NULL noise: drivers/video/via/hw.c
NULL noise: drivers/usb/host/oxu210hp-hcd.c
NULL noise: drivers/scsi/FlashPoint.c
NULL noise: drivers/platform/x86/panasonic-laptop.c
NULL noise: drivers/pci/dmar.c
NULL noise: drivers/mtd/tests/mtd_*test.c
NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h
NULL noise: drivers/gpu/drm/radeon/radeon_*.c
NULL noise: arch/x86/xen/smp.c
NULL noise: arch/x86/kernel/amd_iommu*.c
NULL noise: arch/x86/kernel


arch/x86/kernel/amd_iommu.c | 2 +-
arch/x86/kernel/amd_iommu_init.c | 2 +-
arch/x86/kernel/io_apic.c | 2 +-
arch/x86/kernel/machine_kexec_32.c | 2 +-
arch/x86/kernel/traps.c | 2 +-
arch/x86/xen/smp.c | 4 ++--
drivers/gpu/drm/radeon/r600_cp.c | 2 +-
drivers/gpu/drm/radeon/radeon_cp.c | 2 +-
drivers/gpu/drm/radeon/radeon_state.c | 2 +-
drivers/media/dvb/frontends/drx397xD.c | 2 +-
drivers/mtd/tests/mtd_oobtest.c | 24 ++++++++++++------------
drivers/mtd/tests/mtd_readtest.c | 2 +-
drivers/pci/dmar.c | 4 ++--
drivers/platform/x86/panasonic-laptop.c | 2 +-
drivers/scsi/FlashPoint.c | 7 +++----
drivers/usb/host/oxu210hp-hcd.c | 2 +-
drivers/video/via/hw.c | 2 +-
fs/reiserfs/inode.c | 2 +-
fs/super.c | 2 +-
kernel/test_kprobes.c | 6 +++---
mm/memcontrol.c | 2 +-
21 files changed, 38 insertions(+), 39 deletions(-)


2009-03-05 19:13:26

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 01/15] NULL noise: arch/x86/kernel

Fix this sparse warnings:
arch/x86/kernel/io_apic.c:3474:37: warning: Using plain integer as NULL pointer
arch/x86/kernel/machine_kexec_32.c:124:22: warning: Using plain integer as NULL pointer
arch/x86/kernel/traps.c:950:24: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

arch/x86/kernel/io_apic.c | 2 +-
arch/x86/kernel/machine_kexec_32.c | 2 +-
arch/x86/kernel/traps.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index a89878e..d9fe0ed 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -3471,7 +3471,7 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
unsigned int irq_want;

#ifdef CONFIG_INTR_REMAP
- struct intel_iommu *iommu = 0;
+ struct intel_iommu *iommu = NULL;
int index = 0;
#endif

diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index 37f4200..f5fc8c7 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -121,7 +121,7 @@ static void machine_kexec_page_table_set_one(
static void machine_kexec_prepare_page_tables(struct kimage *image)
{
void *control_page;
- pmd_t *pmd = 0;
+ pmd_t *pmd = NULL;

control_page = page_address(image->control_code_page);
#ifdef CONFIG_X86_PAE
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index ba90406..6882089 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -947,7 +947,7 @@ dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code)
info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = ILL_BADSTK;
- info.si_addr = 0;
+ info.si_addr = NULL;
if (notify_die(DIE_TRAP, "iret exception",
regs, error_code, 32, SIGILL) == NOTIFY_STOP)
return;

2009-03-05 19:14:04

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 02/15] NULL noise: arch/x86/kernel/amd_iommu*.c

Fix this sparse warning(s):
arch/x86/kernel/amd_iommu_init.c:901:37: warning: Using plain integer as NULL pointer
arch/x86/kernel/amd_iommu.c:1522:24: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

arch/x86/kernel/amd_iommu.c | 2 +-
arch/x86/kernel/amd_iommu_init.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 008e522..3f6e1c8 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1519,7 +1519,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
flag |= __GFP_ZERO;
virt_addr = (void *)__get_free_pages(flag, get_order(size));
if (!virt_addr)
- return 0;
+ return NULL;

paddr = virt_to_phys(virt_addr);

diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 42c33ce..f80cca9 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -898,7 +898,7 @@ static int __init init_exclusion_range(struct ivmd_header *m)
/* called for unity map ACPI definition */
static int __init init_unity_map_range(struct ivmd_header *m)
{
- struct unity_map_entry *e = 0;
+ struct unity_map_entry *e = NULL;

e = kzalloc(sizeof(*e), GFP_KERNEL);
if (e == NULL)

2009-03-05 19:14:27

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 03/15] NULL noise: arch/x86/xen/smp.c

Fix this sparse warnings:
arch/x86/xen/smp.c:316:52: warning: Using plain integer as NULL pointer
arch/x86/xen/smp.c:421:60: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

arch/x86/xen/smp.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 035582a..7a1f00f 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -313,7 +313,7 @@ static int __cpuinit xen_cpu_up(unsigned int cpu)
BUG_ON(rc);

while(per_cpu(cpu_state, cpu) != CPU_ONLINE) {
- HYPERVISOR_sched_op(SCHEDOP_yield, 0);
+ HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
barrier();
}

@@ -418,7 +418,7 @@ static void xen_smp_send_call_function_ipi(const struct cpumask *mask)
/* Make sure other vcpus get a chance to run if they need to. */
for_each_cpu(cpu, mask) {
if (xen_vcpu_stolen(cpu)) {
- HYPERVISOR_sched_op(SCHEDOP_yield, 0);
+ HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
break;
}
}

2009-03-05 19:15:03

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 04/15] NULL noise: drivers/gpu/drm/radeon/radeon_*.c

Fix this sparse warning:
drivers/gpu/drm/radeon/r600_cp.c:1811:52: warning: Using plain integer as NULL pointer
drivers/gpu/drm/radeon/radeon_cp.c:1363:52: warning: Using plain integer as NULL pointer
drivers/gpu/drm/radeon/radeon_state.c:1983:61: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

drivers/gpu/drm/radeon/r600_cp.c | 2 +-
drivers/gpu/drm/radeon/radeon_cp.c | 2 +-
drivers/gpu/drm/radeon/radeon_state.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c
index 37249b2..2d9147d 100644
--- a/drivers/gpu/drm/radeon/r600_cp.c
+++ b/drivers/gpu/drm/radeon/r600_cp.c
@@ -1808,7 +1808,7 @@ int r600_do_cleanup_cp(struct drm_device *dev)

if (dev_priv->gart_info.gart_table_location == DRM_ATI_GART_FB) {
drm_core_ioremapfree(&dev_priv->gart_info.mapping, dev);
- dev_priv->gart_info.addr = 0;
+ dev_priv->gart_info.addr = NULL;
}
}
/* only clear to the start of flags */
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c
index 15cfe56..0c49230 100644
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/drivers/gpu/drm/radeon/radeon_cp.c
@@ -1541,7 +1541,7 @@ static int radeon_do_cleanup_cp(struct drm_device * dev)
if (dev_priv->gart_info.gart_table_location == DRM_ATI_GART_FB)
{
drm_core_ioremapfree(&dev_priv->gart_info.mapping, dev);
- dev_priv->gart_info.addr = 0;
+ dev_priv->gart_info.addr = NULL;
}
}
/* only clear to the start of flags */
diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c
index ca00cef..fa728ec 100644
--- a/drivers/gpu/drm/radeon/radeon_state.c
+++ b/drivers/gpu/drm/radeon/radeon_state.c
@@ -1986,7 +1986,7 @@ static int alloc_surface(drm_radeon_surface_alloc_t *new,

/* find a virtual surface */
for (i = 0; i < 2 * RADEON_MAX_SURFACES; i++)
- if (dev_priv->virt_surfaces[i].file_priv == 0)
+ if (dev_priv->virt_surfaces[i].file_priv == NULL)
break;
if (i == 2 * RADEON_MAX_SURFACES) {
return -1;

2009-03-05 19:15:29

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 05/15] NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h

Fix this sparse warnings:
drivers/media/dvb/frontends/drx397xD_fw.h:21:2: warning: Using plain integer as NULL pointer
drivers/media/dvb/frontends/drx397xD_fw.h:22:2: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

drivers/media/dvb/frontends/drx397xD.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/drx397xD.c b/drivers/media/dvb/frontends/drx397xD.c
index 1e81e71..172f1f9 100644
--- a/drivers/media/dvb/frontends/drx397xD.c
+++ b/drivers/media/dvb/frontends/drx397xD.c
@@ -74,7 +74,7 @@ static struct {
} fw[] = {
#define _FW_ENTRY(a, b, c) { \
.name = a, \
- .file = 0, \
+ .file = NULL, \
.lock = __RW_LOCK_UNLOCKED(fw[c].lock), \
.refcnt = 0, \
.data = { } }

2009-03-05 19:16:13

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 06/15] NULL noise: drivers/mtd/tests/mtd_*test.c

Fix this sparse warnings:
drivers/mtd/tests/mtd_oobtest.c:139:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:192:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:219:41: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:284:25: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:525:25: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:545:25: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:569:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:589:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:613:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:633:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:673:41: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:701:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_readtest.c:74:41: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
Acked-by: Artem Bityutskiy <[email protected]>
---
v2: other subject, as suggested by Al Viro

drivers/mtd/tests/mtd_oobtest.c | 24 ++++++++++++------------
drivers/mtd/tests/mtd_readtest.c | 2 +-
2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
index afbc3f8..a18e8d2 100644
--- a/drivers/mtd/tests/mtd_oobtest.c
+++ b/drivers/mtd/tests/mtd_oobtest.c
@@ -136,7 +136,7 @@ static int write_eraseblock(int ebnum)
ops.ooblen = use_len;
ops.oobretlen = 0;
ops.ooboffs = use_offset;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = writebuf;
err = mtd->write_oob(mtd, addr, &ops);
if (err || ops.oobretlen != use_len) {
@@ -189,7 +189,7 @@ static int verify_eraseblock(int ebnum)
ops.ooblen = use_len;
ops.oobretlen = 0;
ops.ooboffs = use_offset;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = readbuf;
err = mtd->read_oob(mtd, addr, &ops);
if (err || ops.oobretlen != use_len) {
@@ -216,7 +216,7 @@ static int verify_eraseblock(int ebnum)
ops.ooblen = mtd->ecclayout->oobavail;
ops.oobretlen = 0;
ops.ooboffs = 0;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = readbuf;
err = mtd->read_oob(mtd, addr, &ops);
if (err || ops.oobretlen != mtd->ecclayout->oobavail) {
@@ -281,7 +281,7 @@ static int verify_eraseblock_in_one_go(int ebnum)
ops.ooblen = len;
ops.oobretlen = 0;
ops.ooboffs = 0;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = readbuf;
err = mtd->read_oob(mtd, addr, &ops);
if (err || ops.oobretlen != len) {
@@ -522,7 +522,7 @@ static int __init mtd_oobtest_init(void)
ops.ooblen = 1;
ops.oobretlen = 0;
ops.ooboffs = mtd->ecclayout->oobavail;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = writebuf;
printk(PRINT_PREF "attempting to start write past end of OOB\n");
printk(PRINT_PREF "an error is expected...\n");
@@ -542,7 +542,7 @@ static int __init mtd_oobtest_init(void)
ops.ooblen = 1;
ops.oobretlen = 0;
ops.ooboffs = mtd->ecclayout->oobavail;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = readbuf;
printk(PRINT_PREF "attempting to start read past end of OOB\n");
printk(PRINT_PREF "an error is expected...\n");
@@ -566,7 +566,7 @@ static int __init mtd_oobtest_init(void)
ops.ooblen = mtd->ecclayout->oobavail + 1;
ops.oobretlen = 0;
ops.ooboffs = 0;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = writebuf;
printk(PRINT_PREF "attempting to write past end of device\n");
printk(PRINT_PREF "an error is expected...\n");
@@ -586,7 +586,7 @@ static int __init mtd_oobtest_init(void)
ops.ooblen = mtd->ecclayout->oobavail + 1;
ops.oobretlen = 0;
ops.ooboffs = 0;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = readbuf;
printk(PRINT_PREF "attempting to read past end of device\n");
printk(PRINT_PREF "an error is expected...\n");
@@ -610,7 +610,7 @@ static int __init mtd_oobtest_init(void)
ops.ooblen = mtd->ecclayout->oobavail;
ops.oobretlen = 0;
ops.ooboffs = 1;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = writebuf;
printk(PRINT_PREF "attempting to write past end of device\n");
printk(PRINT_PREF "an error is expected...\n");
@@ -630,7 +630,7 @@ static int __init mtd_oobtest_init(void)
ops.ooblen = mtd->ecclayout->oobavail;
ops.oobretlen = 0;
ops.ooboffs = 1;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = readbuf;
printk(PRINT_PREF "attempting to read past end of device\n");
printk(PRINT_PREF "an error is expected...\n");
@@ -670,7 +670,7 @@ static int __init mtd_oobtest_init(void)
ops.ooblen = sz;
ops.oobretlen = 0;
ops.ooboffs = 0;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = writebuf;
err = mtd->write_oob(mtd, addr, &ops);
if (err)
@@ -698,7 +698,7 @@ static int __init mtd_oobtest_init(void)
ops.ooblen = mtd->ecclayout->oobavail * 2;
ops.oobretlen = 0;
ops.ooboffs = 0;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = readbuf;
err = mtd->read_oob(mtd, addr, &ops);
if (err)
diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index 645e77f..79fc453 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -71,7 +71,7 @@ static int read_eraseblock_by_page(int ebnum)
ops.ooblen = mtd->oobsize;
ops.oobretlen = 0;
ops.ooboffs = 0;
- ops.datbuf = 0;
+ ops.datbuf = NULL;
ops.oobbuf = oobbuf;
ret = mtd->read_oob(mtd, addr, &ops);
if (ret || ops.oobretlen != mtd->oobsize) {

2009-03-05 19:17:09

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 09/15] NULL noise: drivers/scsi/FlashPoint.c

Fix this sparse warnings:
drivers/scsi/FlashPoint.c:906:9: warning: Using plain integer as NULL pointer
drivers/scsi/FlashPoint.c:907:53: warning: Using plain integer as NULL pointer
drivers/scsi/FlashPoint.c:922:1: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: fix checkpatch.pl issue.
v2.1: other subject, as suggested by Al Viro

drivers/scsi/FlashPoint.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
index b898d38..9eb2e86 100644
--- a/drivers/scsi/FlashPoint.c
+++ b/drivers/scsi/FlashPoint.c
@@ -903,8 +903,8 @@ static void FPT_autoCmdCmplt(unsigned long p_port, unsigned char p_card);
static void FPT_autoLoadDefaultMap(unsigned long p_port);

static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] =
- { {{0}} };
-static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {0} };
+ { { {NULL} } };
+static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {NULL} };
static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { {{0}} };
static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS] = { {0} };

@@ -918,8 +918,7 @@ static unsigned char FPT_scamHAString[] =

static unsigned short FPT_default_intena = 0;

-static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {
-0};
+static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {NULL};

/*---------------------------------------------------------------------
*

2009-03-05 19:16:32

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 07/15] NULL noise: drivers/pci/dmar.c

Fix this sparse warning(s):
drivers/pci/dmar.c:782:29: warning: Using plain integer as NULL pointer
drivers/pci/dmar.c:790:29: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

drivers/pci/dmar.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 5f33340..4b654b2 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -779,7 +779,7 @@ int dmar_enable_qi(struct intel_iommu *iommu)
qi->desc = (void *)(get_zeroed_page(GFP_KERNEL));
if (!qi->desc) {
kfree(qi);
- iommu->qi = 0;
+ iommu->qi = NULL;
return -ENOMEM;
}

@@ -787,7 +787,7 @@ int dmar_enable_qi(struct intel_iommu *iommu)
if (!qi->desc_status) {
free_page((unsigned long) qi->desc);
kfree(qi);
- iommu->qi = 0;
+ iommu->qi = NULL;
return -ENOMEM;
}

2009-03-05 19:17:51

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 10/15] NULL noise: drivers/usb/host/oxu210hp-hcd.c

Fix this sparse warning:
drivers/usb/host/oxu210hp-hcd.c:2687:42: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

drivers/usb/host/oxu210hp-hcd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index 2947c69..5ac489e 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -2684,7 +2684,7 @@ static int oxu_reset(struct usb_hcd *hcd)
oxu->urb_len = 0;

/* FIMXE */
- hcd->self.controller->dma_mask = 0UL;
+ hcd->self.controller->dma_mask = NULL;

if (oxu->is_otg) {
oxu->caps = hcd->regs + OXU_OTG_CAP_OFFSET;

2009-03-05 19:16:50

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 08/15] NULL noise: drivers/platform/x86/panasonic-laptop.c

Fix this sparse warning:
drivers/platform/x86/panasonic-laptop.c:273:70: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

drivers/platform/x86/panasonic-laptop.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index c47a44d..e178cde 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -270,7 +270,7 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc, u32 *sinf)
union acpi_object *hkey = NULL;
int i;

- status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SINF, 0,
+ status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SINF, NULL,
&buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,

2009-03-05 19:18:16

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 11/15] NULL noise: drivers/video/via/hw.c

Fix this sparse warning:
drivers/video/via/hw.c:2020:46: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

drivers/video/via/hw.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index fcd53ce..70d6b6c 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -2017,7 +2017,7 @@ static void init_gfx_chip_info(void)
/* Indentify GFX Chip Name */
for (i = 0; pciidlist[i].vendor != 0; i++) {
pdev = pci_get_device(pciidlist[i].vendor,
- pciidlist[i].device, 0);
+ pciidlist[i].device, NULL);
if (pdev)
break;
}

2009-03-05 19:18:50

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 13/15] NULL noise: fs/reiserfs/inode.c

Fix this sparse warning:
fs/reiserfs/inode.c:2555:19: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

fs/reiserfs/inode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 823227a..e69d63a 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -2552,7 +2552,7 @@ static int reiserfs_write_begin(struct file *file,
int old_ref = 0;

inode = mapping->host;
- *fsdata = 0;
+ *fsdata = NULL;
if (flags & AOP_FLAG_CONT_EXPAND &&
(pos & (inode->i_sb->s_blocksize - 1)) == 0) {
pos ++;

2009-03-05 19:18:34

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 12/15] NULL noise: fs/super.c

Fix this sparse warning:
fs/super.c:849:26: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

fs/super.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index c38eef4..c6ad02d 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -846,7 +846,7 @@ void kill_block_super(struct super_block *sb)
struct block_device *bdev = sb->s_bdev;
fmode_t mode = sb->s_mode;

- bdev->bd_super = 0;
+ bdev->bd_super = NULL;
generic_shutdown_super(sb);
sync_blockdev(bdev);
close_bdev_exclusive(bdev, mode);

2009-03-05 19:19:20

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 14/15] NULL noise: kernel/test_kprobes.c

Fix this sparse warnings:
kernel/test_kprobes.c:118:19: warning: Using plain integer as NULL pointer
kernel/test_kprobes.c:213:22: warning: Using plain integer as NULL pointer
kernel/test_kprobes.c:326:22: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro

kernel/test_kprobes.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/test_kprobes.c b/kernel/test_kprobes.c
index 4f10451..9a43351 100644
--- a/kernel/test_kprobes.c
+++ b/kernel/test_kprobes.c
@@ -115,7 +115,7 @@ static int test_kprobes(void)
int ret;
struct kprobe *kps[2] = {&kp, &kp2};

- kp.addr = 0; /* addr should be cleard for reusing kprobe. */
+ kp.addr = NULL; /* addr should be cleard for reusing kprobe. */
ret = register_kprobes(kps, 2);
if (ret < 0) {
printk(KERN_ERR "Kprobe smoke test failed: "
@@ -210,7 +210,7 @@ static int test_jprobes(void)
int ret;
struct jprobe *jps[2] = {&jp, &jp2};

- jp.kp.addr = 0; /* addr should be cleard for reusing kprobe. */
+ jp.kp.addr = NULL; /* addr should be cleard for reusing kprobe. */
ret = register_jprobes(jps, 2);
if (ret < 0) {
printk(KERN_ERR "Kprobe smoke test failed: "
@@ -323,7 +323,7 @@ static int test_kretprobes(void)
int ret;
struct kretprobe *rps[2] = {&rp, &rp2};

- rp.kp.addr = 0; /* addr should be cleard for reusing kprobe. */
+ rp.kp.addr = NULL; /* addr should be cleard for reusing kprobe. */
ret = register_kretprobes(rps, 2);
if (ret < 0) {
printk(KERN_ERR "Kprobe smoke test failed: "

2009-03-05 19:19:41

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v2 15/15] NULL noise: mm/memcontrol.c

Fix this sparse warning:
mm/memcontrol.c:1637:32: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
---
v2: other subject, as suggested by Al Viro

mm/memcontrol.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 8e4be9c..09d6650 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1634,7 +1634,7 @@ static int mem_cgroup_force_empty_list(struct mem_cgroup *mem,
pc = list_entry(list->prev, struct page_cgroup, lru);
if (busy == pc) {
list_move(&pc->lru, list);
- busy = 0;
+ busy = NULL;
spin_unlock_irqrestore(&zone->lru_lock, flags);
continue;
}

2009-03-05 19:54:31

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v3 02/15] NULL noise: arch/x86/kernel/amd_iommu*.c

Fix this sparse warning(s):
arch/x86/kernel/amd_iommu_init.c:901:37: warning: Using plain integer as NULL pointer
arch/x86/kernel/amd_iommu.c:1522:24: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: other subject, as suggested by Al Viro
v3: no need to init the variable (thanks to Joe Perches)

arch/x86/kernel/amd_iommu.c | 2 +-
arch/x86/kernel/amd_iommu_init.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 008e522..3f6e1c8 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1519,7 +1519,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
flag |= __GFP_ZERO;
virt_addr = (void *)__get_free_pages(flag, get_order(size));
if (!virt_addr)
- return 0;
+ return NULL;

paddr = virt_to_phys(virt_addr);

diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 42c33ce..9bccd0f 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -898,7 +898,7 @@ static int __init init_exclusion_range(struct ivmd_header *m)
/* called for unity map ACPI definition */
static int __init init_unity_map_range(struct ivmd_header *m)
{
- struct unity_map_entry *e = 0;
+ struct unity_map_entry *e;

e = kzalloc(sizeof(*e), GFP_KERNEL);
if (e == NULL)

2009-03-05 20:06:06

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCH v2 09/15] NULL noise: drivers/scsi/FlashPoint.c

On Thu, 2009-03-05 at 20:16 +0100, Hannes Eder wrote:
> Fix this sparse warnings:
> drivers/scsi/FlashPoint.c:906:9: warning: Using plain integer as NULL pointer
> drivers/scsi/FlashPoint.c:907:53: warning: Using plain integer as NULL pointer
> drivers/scsi/FlashPoint.c:922:1: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Hannes Eder <[email protected]>
> ---
> v2: fix checkpatch.pl issue.
> v2.1: other subject, as suggested by Al Viro
>
> drivers/scsi/FlashPoint.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
> index b898d38..9eb2e86 100644
> --- a/drivers/scsi/FlashPoint.c
> +++ b/drivers/scsi/FlashPoint.c
> @@ -903,8 +903,8 @@ static void FPT_autoCmdCmplt(unsigned long p_port, unsigned char p_card);
> static void FPT_autoLoadDefaultMap(unsigned long p_port);
>
> static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] =
> L- { {{0}} };
> -static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {0} };
> + { { {NULL} } };
> +static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {NULL} };
> static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { {{0}} };
> static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS] = { {0} };

This doesn't look right: {0} as a structure initialiser is a C
convention for zero fill this structure; sparse should recognise this.
Of course, since these structures are static, they should be in BSS
anyway ...

> @@ -918,8 +918,7 @@ static unsigned char FPT_scamHAString[] =
>
> static unsigned short FPT_default_intena = 0;
>
> -static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {
> -0};
> +static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {NULL};
>
> /*---------------------------------------------------------------------
> *

James

2009-03-05 20:15:35

by Hannes Eder

[permalink] [raw]
Subject: Re: [PATCH v2 09/15] NULL noise: drivers/scsi/FlashPoint.c

On Thu, Mar 5, 2009 at 9:05 PM, James Bottomley
<[email protected]> wrote:
> On Thu, 2009-03-05 at 20:16 +0100, Hannes Eder wrote:
>> Fix this sparse warnings:
>> ? drivers/scsi/FlashPoint.c:906:9: warning: Using plain integer as NULL pointer
>> ? drivers/scsi/FlashPoint.c:907:53: warning: Using plain integer as NULL pointer
>> ? drivers/scsi/FlashPoint.c:922:1: warning: Using plain integer as NULL pointer
>>
>> Signed-off-by: Hannes Eder <[email protected]>
>> ---
>> v2: fix checkpatch.pl issue.
>> v2.1: other subject, as suggested by Al Viro
>>
>> ?drivers/scsi/FlashPoint.c | ? ?7 +++----
>> ?1 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
>> index b898d38..9eb2e86 100644
>> --- a/drivers/scsi/FlashPoint.c
>> +++ b/drivers/scsi/FlashPoint.c
>> @@ -903,8 +903,8 @@ static void FPT_autoCmdCmplt(unsigned long p_port, unsigned char p_card);
>> ?static void FPT_autoLoadDefaultMap(unsigned long p_port);
>>
>> ?static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] =
>> L- ? ?{ {{0}} };
>> -static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {0} };
>> + ? ?{ { {NULL} } };
>> +static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {NULL} };
>> ?static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { {{0}} };
>> ?static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS] = { {0} };
>
> This doesn't look right: ?{0} as a structure initialiser is a C
> convention for zero fill this structure; sparse should recognise this.
> Of course, since these structures are static, they should be in BSS
> anyway ...

So a proper fix is just not to initialize the variables.

... and report this issue to the sparse mailing list.

>
>> @@ -918,8 +918,7 @@ static unsigned char FPT_scamHAString[] =
>>
>> ?static unsigned short FPT_default_intena = 0;
>>
>> -static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {
>> -0};
>> +static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {NULL};
>>
>> ?/*---------------------------------------------------------------------
>> ? *

Same her, right?

2009-03-05 20:15:51

by Jeremy Fitzhardinge

[permalink] [raw]
Subject: Re: [PATCH v2 03/15] NULL noise: arch/x86/xen/smp.c

Hannes Eder wrote:
> Fix this sparse warnings:
> arch/x86/xen/smp.c:316:52: warning: Using plain integer as NULL pointer
> arch/x86/xen/smp.c:421:60: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Hannes Eder <[email protected]>
>
Acked-by: Jeremy Fitzhardinge <[email protected]>

J

2009-03-05 21:56:25

by Hannes Eder

[permalink] [raw]
Subject: [PATCH v3 09/15] NULL noise: drivers/scsi/FlashPoint.c

Fix this sparse warnings:
drivers/scsi/FlashPoint.c:906:9: warning: Using plain integer as NULL pointer
drivers/scsi/FlashPoint.c:907:53: warning: Using plain integer as NULL pointer
drivers/scsi/FlashPoint.c:922:1: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <[email protected]>
---
v2: fix checkpatch.pl issue.
v2.1: other subject, as suggested by Al Viro
v3: no need to explicitly initialize the variables, as they are in the
.bss section anyway (pointed out by James Bottomley)

drivers/scsi/FlashPoint.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
index b898d38..ac67307 100644
--- a/drivers/scsi/FlashPoint.c
+++ b/drivers/scsi/FlashPoint.c
@@ -902,13 +902,12 @@ static unsigned char FPT_scmachid(unsigned char p_card,
static void FPT_autoCmdCmplt(unsigned long p_port, unsigned char p_card);
static void FPT_autoLoadDefaultMap(unsigned long p_port);

-static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] =
- { {{0}} };
-static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {0} };
-static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { {{0}} };
-static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS] = { {0} };
+static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
+static struct sccb_card FPT_BL_Card[MAX_CARDS];
+static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR];
+static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS];

-static unsigned char FPT_mbCards = 0;
+static unsigned char FPT_mbCards;
static unsigned char FPT_scamHAString[] =
{ 0x63, 0x07, 'B', 'U', 'S', 'L', 'O', 'G', 'I', 'C',
' ', 'B', 'T', '-', '9', '3', '0',
@@ -916,10 +915,9 @@ static unsigned char FPT_scamHAString[] =
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20
};

-static unsigned short FPT_default_intena = 0;
+static unsigned short FPT_default_intena;

-static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {
-0};
+static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char);

/*---------------------------------------------------------------------
*

2009-03-05 21:59:18

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCH v2 09/15] NULL noise: drivers/scsi/FlashPoint.c

On Thu, 2009-03-05 at 21:15 +0100, Hannes Eder wrote:
> On Thu, Mar 5, 2009 at 9:05 PM, James Bottomley
> <[email protected]> wrote:
> > On Thu, 2009-03-05 at 20:16 +0100, Hannes Eder wrote:
> >> Fix this sparse warnings:
> >> drivers/scsi/FlashPoint.c:906:9: warning: Using plain integer as NULL pointer
> >> drivers/scsi/FlashPoint.c:907:53: warning: Using plain integer as NULL pointer
> >> drivers/scsi/FlashPoint.c:922:1: warning: Using plain integer as NULL pointer
> >>
> >> Signed-off-by: Hannes Eder <[email protected]>
> >> ---
> >> v2: fix checkpatch.pl issue.
> >> v2.1: other subject, as suggested by Al Viro
> >>
> >> drivers/scsi/FlashPoint.c | 7 +++----
> >> 1 files changed, 3 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
> >> index b898d38..9eb2e86 100644
> >> --- a/drivers/scsi/FlashPoint.c
> >> +++ b/drivers/scsi/FlashPoint.c
> >> @@ -903,8 +903,8 @@ static void FPT_autoCmdCmplt(unsigned long p_port, unsigned char p_card);
> >> static void FPT_autoLoadDefaultMap(unsigned long p_port);
> >>
> >> static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] =
> >> L- { {{0}} };
> >> -static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {0} };
> >> + { { {NULL} } };
> >> +static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {NULL} };
> >> static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { {{0}} };
> >> static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS] = { {0} };
> >
> > This doesn't look right: {0} as a structure initialiser is a C
> > convention for zero fill this structure; sparse should recognise this.
> > Of course, since these structures are static, they should be in BSS
> > anyway ...
>
> So a proper fix is just not to initialize the variables.

That works ... and probably also teach sparse to recognise {0}.

> ... and report this issue to the sparse mailing list.
>
> >
> >> @@ -918,8 +918,7 @@ static unsigned char FPT_scamHAString[] =
> >>
> >> static unsigned short FPT_default_intena = 0;
> >>
> >> -static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {
> >> -0};
> >> +static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {NULL};
> >>
> >> /*---------------------------------------------------------------------
> >> *
>
> Same her, right?

I had to look that one up, but yes, it appears {0} does zero initialise
an array as well.

James

2009-03-05 22:42:34

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH v2 15/15] NULL noise: mm/memcontrol.c

On Thu, 05 Mar 2009 20:18:44 +0100
Hannes Eder <[email protected]> wrote:

> Fix this sparse warning:
> mm/memcontrol.c:1637:32: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Hannes Eder <[email protected]>
> Acked-by: KAMEZAWA Hiroyuki <[email protected]>
> ---
> v2: other subject, as suggested by Al Viro
>
> mm/memcontrol.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 8e4be9c..09d6650 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1634,7 +1634,7 @@ static int mem_cgroup_force_empty_list(struct mem_cgroup *mem,
> pc = list_entry(list->prev, struct page_cgroup, lru);
> if (busy == pc) {
> list_move(&pc->lru, list);
> - busy = 0;
> + busy = NULL;
> spin_unlock_irqrestore(&zone->lru_lock, flags);
> continue;
> }

I have to say that I wish sparse didn't do this. Initialising a
pointer with literal zero is perfectly clear and is idiomatic C.

2009-03-05 23:05:06

by Hannes Eder

[permalink] [raw]
Subject: Re: [PATCH v2 15/15] NULL noise: mm/memcontrol.c

On Thu, Mar 5, 2009 at 11:42 PM, Andrew Morton
<[email protected]> wrote:
> On Thu, 05 Mar 2009 20:18:44 +0100
> Hannes Eder <[email protected]> wrote:
>
>> Fix this sparse warning:
>> ? mm/memcontrol.c:1637:32: warning: Using plain integer as NULL pointer
>>
>> Signed-off-by: Hannes Eder <[email protected]>
>> Acked-by: KAMEZAWA Hiroyuki <[email protected]>
>> ---
>> v2: other subject, as suggested by Al Viro
>>
>> ?mm/memcontrol.c | ? ?2 +-
>> ?1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index 8e4be9c..09d6650 100644
>> --- a/mm/memcontrol.c
>> +++ b/mm/memcontrol.c
>> @@ -1634,7 +1634,7 @@ static int mem_cgroup_force_empty_list(struct mem_cgroup *mem,
>> ? ? ? ? ? ? ? pc = list_entry(list->prev, struct page_cgroup, lru);
>> ? ? ? ? ? ? ? if (busy == pc) {
>> ? ? ? ? ? ? ? ? ? ? ? list_move(&pc->lru, list);
>> - ? ? ? ? ? ? ? ? ? ? busy = 0;
>> + ? ? ? ? ? ? ? ? ? ? busy = NULL;
>> ? ? ? ? ? ? ? ? ? ? ? spin_unlock_irqrestore(&zone->lru_lock, flags);
>> ? ? ? ? ? ? ? ? ? ? ? continue;
>> ? ? ? ? ? ? ? }
>
> I have to say that I wish sparse didn't do this. ?Initialising a
> pointer with literal zero is perfectly clear and is idiomatic C.

We could turn it off with '-Wno-non-pointer-null', but then it is not
reported in other might useful cases either. Well, it's really a minor
thing, but fixing it, isn't a big deal either. Or is there any
drawback that I am not aware of?

2009-03-06 06:09:51

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [PATCH v2 06/15] NULL noise: drivers/mtd/tests/mtd_*test.c

Hannes Eder wrote:
> Fix this sparse warnings:
> drivers/mtd/tests/mtd_oobtest.c:139:33: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:192:33: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:219:41: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:284:25: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:525:25: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:545:25: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:569:33: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:589:33: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:613:33: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:633:33: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:673:41: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_oobtest.c:701:33: warning: Using plain integer as NULL pointer
> drivers/mtd/tests/mtd_readtest.c:74:41: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Hannes Eder <[email protected]>
> Acked-by: Artem Bityutskiy <[email protected]>

Yes, please, take this patch.

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

2009-03-09 10:59:21

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH v2 05/15] NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h

On Thu, 05 Mar 2009 20:14:39 +0100
Hannes Eder <[email protected]> wrote:

> Fix this sparse warnings:
> drivers/media/dvb/frontends/drx397xD_fw.h:21:2: warning: Using plain integer as NULL pointer
> drivers/media/dvb/frontends/drx397xD_fw.h:22:2: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Hannes Eder <[email protected]>

Acked-by: Mauro Carvalho Chehab <[email protected]>

> ---
> v2: other subject, as suggested by Al Viro
>
> drivers/media/dvb/frontends/drx397xD.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/dvb/frontends/drx397xD.c b/drivers/media/dvb/frontends/drx397xD.c
> index 1e81e71..172f1f9 100644
> --- a/drivers/media/dvb/frontends/drx397xD.c
> +++ b/drivers/media/dvb/frontends/drx397xD.c
> @@ -74,7 +74,7 @@ static struct {
> } fw[] = {
> #define _FW_ENTRY(a, b, c) { \
> .name = a, \
> - .file = 0, \
> + .file = NULL, \
> .lock = __RW_LOCK_UNLOCKED(fw[c].lock), \
> .refcnt = 0, \
> .data = { } }
>




Cheers,
Mauro

2009-03-17 13:48:25

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH v2 06/15] NULL noise: drivers/mtd/tests/mtd_*test.c

On Fri, 6 Mar 2009, Artem Bityutskiy wrote:

> Hannes Eder wrote:
> > Fix this sparse warnings:
> > drivers/mtd/tests/mtd_oobtest.c:139:33: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:192:33: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:219:41: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:284:25: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:525:25: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:545:25: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:569:33: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:589:33: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:613:33: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:633:33: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:673:41: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_oobtest.c:701:33: warning: Using plain integer as
> > NULL pointer
> > drivers/mtd/tests/mtd_readtest.c:74:41: warning: Using plain integer as
> > NULL pointer
> >
> > Signed-off-by: Hannes Eder <[email protected]>
> > Acked-by: Artem Bityutskiy <[email protected]>
> Yes, please, take this patch.

Doesn't seem to be present in current -next/-mmotim, applied to trivial
tree.

--
Jiri Kosina

2009-03-17 13:48:44

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH v2 03/15] NULL noise: arch/x86/xen/smp.c

On Thu, 5 Mar 2009, Jeremy Fitzhardinge wrote:

> Hannes Eder wrote:
> > Fix this sparse warnings:
> > arch/x86/xen/smp.c:316:52: warning: Using plain integer as NULL pointer
> > arch/x86/xen/smp.c:421:60: warning: Using plain integer as NULL pointer
> >
> > Signed-off-by: Hannes Eder <[email protected]>
> >
> Acked-by: Jeremy Fitzhardinge <[email protected]>

Noone seems to have picked this so far, so I have applied it to trivial
tree. Thanks,

--
Jiri Kosina

2009-03-17 14:29:35

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [PATCH v2 06/15] NULL noise: drivers/mtd/tests/mtd_*test.c

Jiri Kosina wrote:
>>> drivers/mtd/tests/mtd_oobtest.c:673:41: warning: Using plain integer as
>>> NULL pointer
>>> drivers/mtd/tests/mtd_oobtest.c:701:33: warning: Using plain integer as
>>> NULL pointer
>>> drivers/mtd/tests/mtd_readtest.c:74:41: warning: Using plain integer as
>>> NULL pointer
>>>
>>> Signed-off-by: Hannes Eder <[email protected]>
>>> Acked-by: Artem Bityutskiy <[email protected]>
>> Yes, please, take this patch.
>
> Doesn't seem to be present in current -next/-mmotim, applied to trivial
> tree.

Fine with me. (CCed linux-mtd).

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

2009-03-17 15:50:39

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH v2 05/15] NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h

On Mon, 9 Mar 2009, Mauro Carvalho Chehab wrote:

> > Fix this sparse warnings:
> > drivers/media/dvb/frontends/drx397xD_fw.h:21:2: warning: Using plain integer as NULL pointer
> > drivers/media/dvb/frontends/drx397xD_fw.h:22:2: warning: Using plain integer as NULL pointer
> >
> > Signed-off-by: Hannes Eder <[email protected]>
> Acked-by: Mauro Carvalho Chehab <[email protected]>

Doesn't seem to be present in current -next/-mmotim, applied to trivial
tree.

--
Jiri Kosina

2009-03-18 01:45:27

by Jeremy Fitzhardinge

[permalink] [raw]
Subject: Re: [PATCH v2 03/15] NULL noise: arch/x86/xen/smp.c

Jiri Kosina wrote:
>
> Noone seems to have picked this so far, so I have applied it to trivial
> tree. Thanks,
>

I've got it queued up, but I'm sure we'll be able to resolve any
conflicts if it goes via both paths...

J

2009-03-18 10:29:47

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH v2 03/15] NULL noise: arch/x86/xen/smp.c

On Tue, 17 Mar 2009, Jeremy Fitzhardinge wrote:

> > Noone seems to have picked this so far, so I have applied it to trivial
> > tree. Thanks,
> I've got it queued up, but I'm sure we'll be able to resolve any conflicts if
> it goes via both paths...

No problem, I have dropped it from trivial tree, thanks for letting me
know.

--
Jiri Kosina
SUSE Labs

2009-04-07 05:56:39

by Len Brown

[permalink] [raw]
Subject: Re: [PATCH v2 08/15] NULL noise: drivers/platform/x86/panasonic-laptop.c

applied

thanks,
Len Brown, Intel Open Source Technology Center