diff options
author | David S. Miller <davem@davemloft.net> | 2011-02-27 02:40:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-16 21:19:15 -0400 |
commit | c6fee0810df4e0f4cf9c4834d2569ca01c02cffc (patch) | |
tree | 7b6adabf750ca0279895f8b9aa8a42eb9837e4e2 /arch/sparc | |
parent | 0399bb5b918bd8ffbf065a3db142ff121aaa18e0 (diff) |
sparc64: Fix build errors with gcc-4.6.0
Most of the warnings emitted (we fail arch/sparc file
builds with -Werror) were legitimate but harmless, however
one case (n2_pcr_write) was a genuine bug.
Based almost entirely upon a patch by Sam Ravnborg.
Reported-by: Dennis Gilmore <dennis@ausil.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/iommu.c | 3 | ||||
-rw-r--r-- | arch/sparc/kernel/ldc.c | 28 | ||||
-rw-r--r-- | arch/sparc/kernel/pci.c | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/pci_common.c | 11 | ||||
-rw-r--r-- | arch/sparc/kernel/pci_fire.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/pci_schizo.c | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/pci_sun4v.c | 3 | ||||
-rw-r--r-- | arch/sparc/kernel/pcr.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/ptrace_64.c | 3 | ||||
-rw-r--r-- | arch/sparc/kernel/smp_64.c | 11 | ||||
-rw-r--r-- | arch/sparc/kernel/traps_64.c | 3 |
11 files changed, 36 insertions, 35 deletions
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index 72509d0e34be..6f01e8c83197 100644 --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c | |||
@@ -333,13 +333,10 @@ static void dma_4u_free_coherent(struct device *dev, size_t size, | |||
333 | void *cpu, dma_addr_t dvma) | 333 | void *cpu, dma_addr_t dvma) |
334 | { | 334 | { |
335 | struct iommu *iommu; | 335 | struct iommu *iommu; |
336 | iopte_t *iopte; | ||
337 | unsigned long flags, order, npages; | 336 | unsigned long flags, order, npages; |
338 | 337 | ||
339 | npages = IO_PAGE_ALIGN(size) >> IO_PAGE_SHIFT; | 338 | npages = IO_PAGE_ALIGN(size) >> IO_PAGE_SHIFT; |
340 | iommu = dev->archdata.iommu; | 339 | iommu = dev->archdata.iommu; |
341 | iopte = iommu->page_table + | ||
342 | ((dvma - iommu->page_table_map_base) >> IO_PAGE_SHIFT); | ||
343 | 340 | ||
344 | spin_lock_irqsave(&iommu->lock, flags); | 341 | spin_lock_irqsave(&iommu->lock, flags); |
345 | 342 | ||
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index df39a0f0d27a..732b0bce6001 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c | |||
@@ -790,16 +790,20 @@ static void send_events(struct ldc_channel *lp, unsigned int event_mask) | |||
790 | static irqreturn_t ldc_rx(int irq, void *dev_id) | 790 | static irqreturn_t ldc_rx(int irq, void *dev_id) |
791 | { | 791 | { |
792 | struct ldc_channel *lp = dev_id; | 792 | struct ldc_channel *lp = dev_id; |
793 | unsigned long orig_state, hv_err, flags; | 793 | unsigned long orig_state, flags; |
794 | unsigned int event_mask; | 794 | unsigned int event_mask; |
795 | 795 | ||
796 | spin_lock_irqsave(&lp->lock, flags); | 796 | spin_lock_irqsave(&lp->lock, flags); |
797 | 797 | ||
798 | orig_state = lp->chan_state; | 798 | orig_state = lp->chan_state; |
799 | hv_err = sun4v_ldc_rx_get_state(lp->id, | 799 | |
800 | &lp->rx_head, | 800 | /* We should probably check for hypervisor errors here and |
801 | &lp->rx_tail, | 801 | * reset the LDC channel if we get one. |
802 | &lp->chan_state); | 802 | */ |
803 | sun4v_ldc_rx_get_state(lp->id, | ||
804 | &lp->rx_head, | ||
805 | &lp->rx_tail, | ||
806 | &lp->chan_state); | ||
803 | 807 | ||
804 | ldcdbg(RX, "RX state[0x%02lx:0x%02lx] head[0x%04lx] tail[0x%04lx]\n", | 808 | ldcdbg(RX, "RX state[0x%02lx:0x%02lx] head[0x%04lx] tail[0x%04lx]\n", |
805 | orig_state, lp->chan_state, lp->rx_head, lp->rx_tail); | 809 | orig_state, lp->chan_state, lp->rx_head, lp->rx_tail); |
@@ -904,16 +908,20 @@ out: | |||
904 | static irqreturn_t ldc_tx(int irq, void *dev_id) | 908 | static irqreturn_t ldc_tx(int irq, void *dev_id) |
905 | { | 909 | { |
906 | struct ldc_channel *lp = dev_id; | 910 | struct ldc_channel *lp = dev_id; |
907 | unsigned long flags, hv_err, orig_state; | 911 | unsigned long flags, orig_state; |
908 | unsigned int event_mask = 0; | 912 | unsigned int event_mask = 0; |
909 | 913 | ||
910 | spin_lock_irqsave(&lp->lock, flags); | 914 | spin_lock_irqsave(&lp->lock, flags); |
911 | 915 | ||
912 | orig_state = lp->chan_state; | 916 | orig_state = lp->chan_state; |
913 | hv_err = sun4v_ldc_tx_get_state(lp->id, | 917 | |
914 | &lp->tx_head, | 918 | /* We should probably check for hypervisor errors here and |
915 | &lp->tx_tail, | 919 | * reset the LDC channel if we get one. |
916 | &lp->chan_state); | 920 | */ |
921 | sun4v_ldc_tx_get_state(lp->id, | ||
922 | &lp->tx_head, | ||
923 | &lp->tx_tail, | ||
924 | &lp->chan_state); | ||
917 | 925 | ||
918 | ldcdbg(TX, " TX state[0x%02lx:0x%02lx] head[0x%04lx] tail[0x%04lx]\n", | 926 | ldcdbg(TX, " TX state[0x%02lx:0x%02lx] head[0x%04lx] tail[0x%04lx]\n", |
919 | orig_state, lp->chan_state, lp->tx_head, lp->tx_tail); | 927 | orig_state, lp->chan_state, lp->tx_head, lp->tx_tail); |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index bfede51c3afc..44f41e312f73 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -675,6 +675,7 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus) | |||
675 | * humanoid. | 675 | * humanoid. |
676 | */ | 676 | */ |
677 | err = sysfs_create_file(&dev->dev.kobj, &dev_attr_obppath.attr); | 677 | err = sysfs_create_file(&dev->dev.kobj, &dev_attr_obppath.attr); |
678 | (void) err; | ||
678 | } | 679 | } |
679 | list_for_each_entry(child_bus, &bus->children, node) | 680 | list_for_each_entry(child_bus, &bus->children, node) |
680 | pci_bus_register_of_sysfs(child_bus); | 681 | pci_bus_register_of_sysfs(child_bus); |
diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index 6c7a33af3ba6..6e3874b64488 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c | |||
@@ -295,14 +295,17 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, | |||
295 | unsigned int bus = bus_dev->number; | 295 | unsigned int bus = bus_dev->number; |
296 | unsigned int device = PCI_SLOT(devfn); | 296 | unsigned int device = PCI_SLOT(devfn); |
297 | unsigned int func = PCI_FUNC(devfn); | 297 | unsigned int func = PCI_FUNC(devfn); |
298 | unsigned long ret; | ||
299 | 298 | ||
300 | if (config_out_of_range(pbm, bus, devfn, where)) { | 299 | if (config_out_of_range(pbm, bus, devfn, where)) { |
301 | /* Do nothing. */ | 300 | /* Do nothing. */ |
302 | } else { | 301 | } else { |
303 | ret = pci_sun4v_config_put(devhandle, | 302 | /* We don't check for hypervisor errors here, but perhaps |
304 | HV_PCI_DEVICE_BUILD(bus, device, func), | 303 | * we should and influence our return value depending upon |
305 | where, size, value); | 304 | * what kind of error is thrown. |
305 | */ | ||
306 | pci_sun4v_config_put(devhandle, | ||
307 | HV_PCI_DEVICE_BUILD(bus, device, func), | ||
308 | where, size, value); | ||
306 | } | 309 | } |
307 | return PCIBIOS_SUCCESSFUL; | 310 | return PCIBIOS_SUCCESSFUL; |
308 | } | 311 | } |
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c index 43d691b67d52..3d70f8326efd 100644 --- a/arch/sparc/kernel/pci_fire.c +++ b/arch/sparc/kernel/pci_fire.c | |||
@@ -214,11 +214,9 @@ static int pci_fire_msi_setup(struct pci_pbm_info *pbm, unsigned long msiqid, | |||
214 | 214 | ||
215 | static int pci_fire_msi_teardown(struct pci_pbm_info *pbm, unsigned long msi) | 215 | static int pci_fire_msi_teardown(struct pci_pbm_info *pbm, unsigned long msi) |
216 | { | 216 | { |
217 | unsigned long msiqid; | ||
218 | u64 val; | 217 | u64 val; |
219 | 218 | ||
220 | val = upa_readq(pbm->pbm_regs + MSI_MAP(msi)); | 219 | val = upa_readq(pbm->pbm_regs + MSI_MAP(msi)); |
221 | msiqid = (val & MSI_MAP_EQNUM); | ||
222 | 220 | ||
223 | val &= ~MSI_MAP_VALID; | 221 | val &= ~MSI_MAP_VALID; |
224 | 222 | ||
diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c index 6783410ceb02..1d41af73a92f 100644 --- a/arch/sparc/kernel/pci_schizo.c +++ b/arch/sparc/kernel/pci_schizo.c | |||
@@ -1313,7 +1313,7 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, | |||
1313 | const struct linux_prom64_registers *regs; | 1313 | const struct linux_prom64_registers *regs; |
1314 | struct device_node *dp = op->dev.of_node; | 1314 | struct device_node *dp = op->dev.of_node; |
1315 | const char *chipset_name; | 1315 | const char *chipset_name; |
1316 | int is_pbm_a, err; | 1316 | int err; |
1317 | 1317 | ||
1318 | switch (chip_type) { | 1318 | switch (chip_type) { |
1319 | case PBM_CHIP_TYPE_TOMATILLO: | 1319 | case PBM_CHIP_TYPE_TOMATILLO: |
@@ -1343,8 +1343,6 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, | |||
1343 | */ | 1343 | */ |
1344 | regs = of_get_property(dp, "reg", NULL); | 1344 | regs = of_get_property(dp, "reg", NULL); |
1345 | 1345 | ||
1346 | is_pbm_a = ((regs[0].phys_addr & 0x00700000) == 0x00600000); | ||
1347 | |||
1348 | pbm->next = pci_pbm_root; | 1346 | pbm->next = pci_pbm_root; |
1349 | pci_pbm_root = pbm; | 1347 | pci_pbm_root = pbm; |
1350 | 1348 | ||
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index 629160772a9d..6cf534681788 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c | |||
@@ -580,7 +580,7 @@ static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm) | |||
580 | { | 580 | { |
581 | static const u32 vdma_default[] = { 0x80000000, 0x80000000 }; | 581 | static const u32 vdma_default[] = { 0x80000000, 0x80000000 }; |
582 | struct iommu *iommu = pbm->iommu; | 582 | struct iommu *iommu = pbm->iommu; |
583 | unsigned long num_tsb_entries, sz, tsbsize; | 583 | unsigned long num_tsb_entries, sz; |
584 | u32 dma_mask, dma_offset; | 584 | u32 dma_mask, dma_offset; |
585 | const u32 *vdma; | 585 | const u32 *vdma; |
586 | 586 | ||
@@ -596,7 +596,6 @@ static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm) | |||
596 | 596 | ||
597 | dma_mask = (roundup_pow_of_two(vdma[1]) - 1UL); | 597 | dma_mask = (roundup_pow_of_two(vdma[1]) - 1UL); |
598 | num_tsb_entries = vdma[1] / IO_PAGE_SIZE; | 598 | num_tsb_entries = vdma[1] / IO_PAGE_SIZE; |
599 | tsbsize = num_tsb_entries * sizeof(iopte_t); | ||
600 | 599 | ||
601 | dma_offset = vdma[0]; | 600 | dma_offset = vdma[0]; |
602 | 601 | ||
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index 7c2ced612b8f..8ac23e660080 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c | |||
@@ -81,7 +81,7 @@ static void n2_pcr_write(u64 val) | |||
81 | unsigned long ret; | 81 | unsigned long ret; |
82 | 82 | ||
83 | ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val); | 83 | ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val); |
84 | if (val != HV_EOK) | 84 | if (ret != HV_EOK) |
85 | write_pcr(val); | 85 | write_pcr(val); |
86 | } | 86 | } |
87 | 87 | ||
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index 9ccc812bc09e..96ee50a80661 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c | |||
@@ -1086,6 +1086,7 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) | |||
1086 | 1086 | ||
1087 | asmlinkage void syscall_trace_leave(struct pt_regs *regs) | 1087 | asmlinkage void syscall_trace_leave(struct pt_regs *regs) |
1088 | { | 1088 | { |
1089 | #ifdef CONFIG_AUDITSYSCALL | ||
1089 | if (unlikely(current->audit_context)) { | 1090 | if (unlikely(current->audit_context)) { |
1090 | unsigned long tstate = regs->tstate; | 1091 | unsigned long tstate = regs->tstate; |
1091 | int result = AUDITSC_SUCCESS; | 1092 | int result = AUDITSC_SUCCESS; |
@@ -1095,7 +1096,7 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs) | |||
1095 | 1096 | ||
1096 | audit_syscall_exit(result, regs->u_regs[UREG_I0]); | 1097 | audit_syscall_exit(result, regs->u_regs[UREG_I0]); |
1097 | } | 1098 | } |
1098 | 1099 | #endif | |
1099 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 1100 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
1100 | trace_sys_exit(regs, regs->u_regs[UREG_G1]); | 1101 | trace_sys_exit(regs, regs->u_regs[UREG_G1]); |
1101 | 1102 | ||
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index 555a76d1f4a1..3e94a8c23238 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
@@ -189,7 +189,7 @@ static inline long get_delta (long *rt, long *master) | |||
189 | void smp_synchronize_tick_client(void) | 189 | void smp_synchronize_tick_client(void) |
190 | { | 190 | { |
191 | long i, delta, adj, adjust_latency = 0, done = 0; | 191 | long i, delta, adj, adjust_latency = 0, done = 0; |
192 | unsigned long flags, rt, master_time_stamp, bound; | 192 | unsigned long flags, rt, master_time_stamp; |
193 | #if DEBUG_TICK_SYNC | 193 | #if DEBUG_TICK_SYNC |
194 | struct { | 194 | struct { |
195 | long rt; /* roundtrip time */ | 195 | long rt; /* roundtrip time */ |
@@ -208,10 +208,8 @@ void smp_synchronize_tick_client(void) | |||
208 | { | 208 | { |
209 | for (i = 0; i < NUM_ROUNDS; i++) { | 209 | for (i = 0; i < NUM_ROUNDS; i++) { |
210 | delta = get_delta(&rt, &master_time_stamp); | 210 | delta = get_delta(&rt, &master_time_stamp); |
211 | if (delta == 0) { | 211 | if (delta == 0) |
212 | done = 1; /* let's lock on to this... */ | 212 | done = 1; /* let's lock on to this... */ |
213 | bound = rt; | ||
214 | } | ||
215 | 213 | ||
216 | if (!done) { | 214 | if (!done) { |
217 | if (i > 0) { | 215 | if (i > 0) { |
@@ -933,13 +931,12 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu) | |||
933 | void flush_dcache_page_all(struct mm_struct *mm, struct page *page) | 931 | void flush_dcache_page_all(struct mm_struct *mm, struct page *page) |
934 | { | 932 | { |
935 | void *pg_addr; | 933 | void *pg_addr; |
936 | int this_cpu; | ||
937 | u64 data0; | 934 | u64 data0; |
938 | 935 | ||
939 | if (tlb_type == hypervisor) | 936 | if (tlb_type == hypervisor) |
940 | return; | 937 | return; |
941 | 938 | ||
942 | this_cpu = get_cpu(); | 939 | preempt_disable(); |
943 | 940 | ||
944 | #ifdef CONFIG_DEBUG_DCFLUSH | 941 | #ifdef CONFIG_DEBUG_DCFLUSH |
945 | atomic_inc(&dcpage_flushes); | 942 | atomic_inc(&dcpage_flushes); |
@@ -964,7 +961,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) | |||
964 | } | 961 | } |
965 | __local_flush_dcache_page(page); | 962 | __local_flush_dcache_page(page); |
966 | 963 | ||
967 | put_cpu(); | 964 | preempt_enable(); |
968 | } | 965 | } |
969 | 966 | ||
970 | void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs) | 967 | void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs) |
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index 1e9770936c3b..1ed547bd850f 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
@@ -2152,7 +2152,7 @@ static void user_instruction_dump(unsigned int __user *pc) | |||
2152 | 2152 | ||
2153 | void show_stack(struct task_struct *tsk, unsigned long *_ksp) | 2153 | void show_stack(struct task_struct *tsk, unsigned long *_ksp) |
2154 | { | 2154 | { |
2155 | unsigned long fp, thread_base, ksp; | 2155 | unsigned long fp, ksp; |
2156 | struct thread_info *tp; | 2156 | struct thread_info *tp; |
2157 | int count = 0; | 2157 | int count = 0; |
2158 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 2158 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
@@ -2173,7 +2173,6 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2173 | flushw_all(); | 2173 | flushw_all(); |
2174 | 2174 | ||
2175 | fp = ksp + STACK_BIAS; | 2175 | fp = ksp + STACK_BIAS; |
2176 | thread_base = (unsigned long) tp; | ||
2177 | 2176 | ||
2178 | printk("Call Trace:\n"); | 2177 | printk("Call Trace:\n"); |
2179 | do { | 2178 | do { |