aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-08-06 12:01:24 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-13 21:50:24 -0400
commitb0d436c739b0d4afcdfe2e97d4d1ee41ea2db62e (patch)
treee1bcbf43d70097c6b86cc53e5a4583643bf42b3b /arch
parenta0a96ee9ba9ea188dee9126dbb404ff6253318cd (diff)
powerpc: Fix a number of sparse warnings
Address some of the trivial sparse warnings in arch/powerpc. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/legacy_serial.c2
-rw-r--r--arch/powerpc/kernel/pci-common.c4
-rw-r--r--arch/powerpc/kernel/pci_64.c2
-rw-r--r--arch/powerpc/kernel/setup_64.c4
-rw-r--r--arch/powerpc/kernel/signal_64.c8
-rw-r--r--arch/powerpc/kernel/smp.c2
-rw-r--r--arch/powerpc/mm/hash_utils_64.c2
-rw-r--r--arch/powerpc/mm/subpage-prot.c4
-rw-r--r--arch/powerpc/perf/core-book3s.c2
-rw-r--r--arch/powerpc/platforms/powernv/opal.c2
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c2
-rw-r--r--arch/powerpc/platforms/pseries/pseries_energy.c4
-rw-r--r--arch/powerpc/platforms/pseries/setup.c2
13 files changed, 20 insertions, 20 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 0733b05eb856..af1c63fc7dac 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -99,7 +99,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
99 legacy_serial_count = index + 1; 99 legacy_serial_count = index + 1;
100 100
101 /* Check if there is a port who already claimed our slot */ 101 /* Check if there is a port who already claimed our slot */
102 if (legacy_serial_infos[index].np != 0) { 102 if (legacy_serial_infos[index].np != NULL) {
103 /* if we still have some room, move it, else override */ 103 /* if we still have some room, move it, else override */
104 if (legacy_serial_count < MAX_LEGACY_SERIAL_PORTS) { 104 if (legacy_serial_count < MAX_LEGACY_SERIAL_PORTS) {
105 printk(KERN_DEBUG "Moved legacy port %d -> %d\n", 105 printk(KERN_DEBUG "Moved legacy port %d -> %d\n",
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 7d22a675fe1a..22fe40140e43 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -306,7 +306,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
306 unsigned long io_offset = 0; 306 unsigned long io_offset = 0;
307 int i, res_bit; 307 int i, res_bit;
308 308
309 if (hose == 0) 309 if (hose == NULL)
310 return NULL; /* should never happen */ 310 return NULL; /* should never happen */
311 311
312 /* If memory, add on the PCI bridge address offset */ 312 /* If memory, add on the PCI bridge address offset */
@@ -1578,7 +1578,7 @@ fake_pci_bus(struct pci_controller *hose, int busnr)
1578{ 1578{
1579 static struct pci_bus bus; 1579 static struct pci_bus bus;
1580 1580
1581 if (hose == 0) { 1581 if (hose == NULL) {
1582 printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr); 1582 printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
1583 } 1583 }
1584 bus.number = busnr; 1584 bus.number = busnr;
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 2e8629654ca8..cdf5aa1411bf 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -109,7 +109,7 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
109 hose = pci_bus_to_host(bus); 109 hose = pci_bus_to_host(bus);
110 110
111 /* Check if we have IOs allocated */ 111 /* Check if we have IOs allocated */
112 if (hose->io_base_alloc == 0) 112 if (hose->io_base_alloc == NULL)
113 return 0; 113 return 0;
114 114
115 pr_debug("IO unmapping for PHB %s\n", hose->dn->full_name); 115 pr_debug("IO unmapping for PHB %s\n", hose->dn->full_name);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index f03770e0fc8d..79ba9b77fe72 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -325,7 +325,7 @@ static void __init initialize_cache_info(void)
325 NULL); 325 NULL);
326 if (lsizep != NULL) 326 if (lsizep != NULL)
327 lsize = *lsizep; 327 lsize = *lsizep;
328 if (sizep == 0 || lsizep == 0) 328 if (sizep == NULL || lsizep == NULL)
329 DBG("Argh, can't find dcache properties ! " 329 DBG("Argh, can't find dcache properties ! "
330 "sizep: %p, lsizep: %p\n", sizep, lsizep); 330 "sizep: %p, lsizep: %p\n", sizep, lsizep);
331 331
@@ -347,7 +347,7 @@ static void __init initialize_cache_info(void)
347 NULL); 347 NULL);
348 if (lsizep != NULL) 348 if (lsizep != NULL)
349 lsize = *lsizep; 349 lsize = *lsizep;
350 if (sizep == 0 || lsizep == 0) 350 if (sizep == NULL || lsizep == NULL)
351 DBG("Argh, can't find icache properties ! " 351 DBG("Argh, can't find icache properties ! "
352 "sizep: %p, lsizep: %p\n", sizep, lsizep); 352 "sizep: %p, lsizep: %p\n", sizep, lsizep);
353 353
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 887e99d85bc2..cbd26928e04d 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -346,13 +346,13 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
346 if (v_regs && !access_ok(VERIFY_READ, v_regs, 34 * sizeof(vector128))) 346 if (v_regs && !access_ok(VERIFY_READ, v_regs, 34 * sizeof(vector128)))
347 return -EFAULT; 347 return -EFAULT;
348 /* Copy 33 vec registers (vr0..31 and vscr) from the stack */ 348 /* Copy 33 vec registers (vr0..31 and vscr) from the stack */
349 if (v_regs != 0 && (msr & MSR_VEC) != 0) 349 if (v_regs != NULL && (msr & MSR_VEC) != 0)
350 err |= __copy_from_user(current->thread.vr, v_regs, 350 err |= __copy_from_user(current->thread.vr, v_regs,
351 33 * sizeof(vector128)); 351 33 * sizeof(vector128));
352 else if (current->thread.used_vr) 352 else if (current->thread.used_vr)
353 memset(current->thread.vr, 0, 33 * sizeof(vector128)); 353 memset(current->thread.vr, 0, 33 * sizeof(vector128));
354 /* Always get VRSAVE back */ 354 /* Always get VRSAVE back */
355 if (v_regs != 0) 355 if (v_regs != NULL)
356 err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]); 356 err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
357 else 357 else
358 current->thread.vrsave = 0; 358 current->thread.vrsave = 0;
@@ -463,7 +463,7 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
463 tm_v_regs, 34 * sizeof(vector128))) 463 tm_v_regs, 34 * sizeof(vector128)))
464 return -EFAULT; 464 return -EFAULT;
465 /* Copy 33 vec registers (vr0..31 and vscr) from the stack */ 465 /* Copy 33 vec registers (vr0..31 and vscr) from the stack */
466 if (v_regs != 0 && tm_v_regs != 0 && (msr & MSR_VEC) != 0) { 466 if (v_regs != NULL && tm_v_regs != NULL && (msr & MSR_VEC) != 0) {
467 err |= __copy_from_user(current->thread.vr, v_regs, 467 err |= __copy_from_user(current->thread.vr, v_regs,
468 33 * sizeof(vector128)); 468 33 * sizeof(vector128));
469 err |= __copy_from_user(current->thread.transact_vr, tm_v_regs, 469 err |= __copy_from_user(current->thread.transact_vr, tm_v_regs,
@@ -474,7 +474,7 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
474 memset(current->thread.transact_vr, 0, 33 * sizeof(vector128)); 474 memset(current->thread.transact_vr, 0, 33 * sizeof(vector128));
475 } 475 }
476 /* Always get VRSAVE back */ 476 /* Always get VRSAVE back */
477 if (v_regs != 0 && tm_v_regs != 0) { 477 if (v_regs != NULL && tm_v_regs != NULL) {
478 err |= __get_user(current->thread.vrsave, 478 err |= __get_user(current->thread.vrsave,
479 (u32 __user *)&v_regs[33]); 479 (u32 __user *)&v_regs[33]);
480 err |= __get_user(current->thread.transact_vrsave, 480 err |= __get_user(current->thread.transact_vrsave,
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 38b0ba65a735..9882240020c0 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -172,7 +172,7 @@ int smp_request_message_ipi(int virq, int msg)
172#endif 172#endif
173 err = request_irq(virq, smp_ipi_action[msg], 173 err = request_irq(virq, smp_ipi_action[msg],
174 IRQF_PERCPU | IRQF_NO_THREAD | IRQF_NO_SUSPEND, 174 IRQF_PERCPU | IRQF_NO_THREAD | IRQF_NO_SUSPEND,
175 smp_ipi_name[msg], 0); 175 smp_ipi_name[msg], NULL);
176 WARN(err < 0, "unable to request_irq %d for %s (rc %d)\n", 176 WARN(err < 0, "unable to request_irq %d for %s (rc %d)\n",
177 virq, smp_ipi_name[msg], err); 177 virq, smp_ipi_name[msg], err);
178 178
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 6ecc38bd5b24..bde8b5589755 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -907,7 +907,7 @@ static int subpage_protection(struct mm_struct *mm, unsigned long ea)
907 907
908 if (ea >= spt->maxaddr) 908 if (ea >= spt->maxaddr)
909 return 0; 909 return 0;
910 if (ea < 0x100000000) { 910 if (ea < 0x100000000UL) {
911 /* addresses below 4GB use spt->low_prot */ 911 /* addresses below 4GB use spt->low_prot */
912 sbpm = spt->low_prot; 912 sbpm = spt->low_prot;
913 } else { 913 } else {
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
index aa74acb0fdfc..a770df2dae70 100644
--- a/arch/powerpc/mm/subpage-prot.c
+++ b/arch/powerpc/mm/subpage-prot.c
@@ -105,7 +105,7 @@ static void subpage_prot_clear(unsigned long addr, unsigned long len)
105 limit = spt->maxaddr; 105 limit = spt->maxaddr;
106 for (; addr < limit; addr = next) { 106 for (; addr < limit; addr = next) {
107 next = pmd_addr_end(addr, limit); 107 next = pmd_addr_end(addr, limit);
108 if (addr < 0x100000000) { 108 if (addr < 0x100000000UL) {
109 spm = spt->low_prot; 109 spm = spt->low_prot;
110 } else { 110 } else {
111 spm = spt->protptrs[addr >> SBP_L3_SHIFT]; 111 spm = spt->protptrs[addr >> SBP_L3_SHIFT];
@@ -219,7 +219,7 @@ long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
219 for (limit = addr + len; addr < limit; addr = next) { 219 for (limit = addr + len; addr < limit; addr = next) {
220 next = pmd_addr_end(addr, limit); 220 next = pmd_addr_end(addr, limit);
221 err = -ENOMEM; 221 err = -ENOMEM;
222 if (addr < 0x100000000) { 222 if (addr < 0x100000000UL) {
223 spm = spt->low_prot; 223 spm = spt->low_prot;
224 } else { 224 } else {
225 spm = spt->protptrs[addr >> SBP_L3_SHIFT]; 225 spm = spt->protptrs[addr >> SBP_L3_SHIFT];
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index eeae308cf982..29b89e863d7c 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -24,7 +24,7 @@
24#define BHRB_MAX_ENTRIES 32 24#define BHRB_MAX_ENTRIES 32
25#define BHRB_TARGET 0x0000000000000002 25#define BHRB_TARGET 0x0000000000000002
26#define BHRB_PREDICTION 0x0000000000000001 26#define BHRB_PREDICTION 0x0000000000000001
27#define BHRB_EA 0xFFFFFFFFFFFFFFFC 27#define BHRB_EA 0xFFFFFFFFFFFFFFFCUL
28 28
29struct cpu_hw_events { 29struct cpu_hw_events {
30 int n_events; 30 int n_events;
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 106301fd2fa5..7c253469f23b 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -422,7 +422,7 @@ void opal_shutdown(void)
422 422
423 for (i = 0; i < opal_irq_count; i++) { 423 for (i = 0; i < opal_irq_count; i++) {
424 if (opal_irqs[i]) 424 if (opal_irqs[i])
425 free_irq(opal_irqs[i], 0); 425 free_irq(opal_irqs[i], NULL);
426 opal_irqs[i] = 0; 426 opal_irqs[i] = 0;
427 } 427 }
428} 428}
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 8bad880bd177..60b6f4e8d63d 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -724,7 +724,7 @@ int h_get_mpp(struct hvcall_mpp_data *mpp_data)
724 724
725 mpp_data->mem_weight = (retbuf[3] >> 7 * 8) & 0xff; 725 mpp_data->mem_weight = (retbuf[3] >> 7 * 8) & 0xff;
726 mpp_data->unallocated_mem_weight = (retbuf[3] >> 6 * 8) & 0xff; 726 mpp_data->unallocated_mem_weight = (retbuf[3] >> 6 * 8) & 0xff;
727 mpp_data->unallocated_entitlement = retbuf[3] & 0xffffffffffff; 727 mpp_data->unallocated_entitlement = retbuf[3] & 0xffffffffffffUL;
728 728
729 mpp_data->pool_size = retbuf[4]; 729 mpp_data->pool_size = retbuf[4];
730 mpp_data->loan_request = retbuf[5]; 730 mpp_data->loan_request = retbuf[5];
diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c
index a91e6dadda2c..92767791f93b 100644
--- a/arch/powerpc/platforms/pseries/pseries_energy.c
+++ b/arch/powerpc/platforms/pseries/pseries_energy.c
@@ -108,8 +108,8 @@ err:
108 * energy consumption. 108 * energy consumption.
109 */ 109 */
110 110
111#define FLAGS_MODE1 0x004E200000080E01 111#define FLAGS_MODE1 0x004E200000080E01UL
112#define FLAGS_MODE2 0x004E200000080401 112#define FLAGS_MODE2 0x004E200000080401UL
113#define FLAGS_ACTIVATE 0x100 113#define FLAGS_ACTIVATE 0x100
114 114
115static ssize_t get_best_energy_list(char *page, int activate) 115static ssize_t get_best_energy_list(char *page, int activate)
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index c11c8238797c..b19cd8334630 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -183,7 +183,7 @@ static void __init pseries_mpic_init_IRQ(void)
183 np = of_find_node_by_path("/"); 183 np = of_find_node_by_path("/");
184 naddr = of_n_addr_cells(np); 184 naddr = of_n_addr_cells(np);
185 opprop = of_get_property(np, "platform-open-pic", &opplen); 185 opprop = of_get_property(np, "platform-open-pic", &opplen);
186 if (opprop != 0) { 186 if (opprop != NULL) {
187 openpic_addr = of_read_number(opprop, naddr); 187 openpic_addr = of_read_number(opprop, naddr);
188 printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); 188 printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
189 } 189 }