* [PATCH 0/5] ia64: Fix compiler warnings @ 2016-05-04 11:17 Matt Fleming 2016-05-04 11:17 ` [PATCH 1/5] ia64/PCI: Fix incorrect PCI resource end address Matt Fleming ` (5 more replies) 0 siblings, 6 replies; 7+ messages in thread From: Matt Fleming @ 2016-05-04 11:17 UTC (permalink / raw) To: Tony Luck, Fenghua Yu Cc: Bjorn Helgaas, linux-ia64, linux-kernel, Matt Fleming I routinely build ia64 kernels when merging EFI patches and for a while now I've seen a bunch of warnings from GCC. These patches silence those warnings, with the first patch fixing an actual bug but the rest just making GCC happier. NOTE: None of these patches have been runtime tested. Matt Fleming (5): ia64/PCI: Fix incorrect PCI resource end address ia64/PCI: Remove unused 'addr' and fix build warning ia64: Reduce stack usage by iterating over nodemask ia64/traps: Silence GCC warning about uninitialised variable ia64/unaligned: Silence another GCC warning about an uninitialised variable arch/ia64/kernel/traps.c | 1 + arch/ia64/kernel/unaligned.c | 1 + arch/ia64/sn/kernel/io_acpi_init.c | 1 - arch/ia64/sn/kernel/io_init.c | 4 ++-- arch/ia64/sn/kernel/sn2/sn2_smp.c | 35 +++++++++++++++++++++++------------ 5 files changed, 27 insertions(+), 15 deletions(-) -- 2.7.3 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/5] ia64/PCI: Fix incorrect PCI resource end address 2016-05-04 11:17 [PATCH 0/5] ia64: Fix compiler warnings Matt Fleming @ 2016-05-04 11:17 ` Matt Fleming 2016-05-04 11:17 ` [PATCH 2/5] ia64/PCI: Remove unused 'addr' and fix build warning Matt Fleming ` (4 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Matt Fleming @ 2016-05-04 11:17 UTC (permalink / raw) To: Tony Luck, Fenghua Yu Cc: Bjorn Helgaas, linux-ia64, linux-kernel, Matt Fleming commit f976721e826e ("ia64/PCI: Use ioremap() instead of open-coded equivalent") introduced the following compiler warning, arch/ia64/sn/kernel/io_init.c: In function 'sn_io_slot_fixup': arch/ia64/sn/kernel/io_init.c:189:19: warning: 'addr' may be used uninitialized in this function [-Wmaybe-uninitialized] res->end = addr + size; ^ 'addr' is indeed uninitialised and the correct value to use is res->start. Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Bjorn Helgaas <helgaas@kernel.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> --- arch/ia64/sn/kernel/io_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index c15a41e2d1f2..d63809a6adfa 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c @@ -151,7 +151,7 @@ sn_io_slot_fixup(struct pci_dev *dev) { int idx; struct resource *res; - unsigned long addr, size; + unsigned long size; struct pcidev_info *pcidev_info; struct sn_irq_info *sn_irq_info; int status; @@ -186,7 +186,7 @@ sn_io_slot_fixup(struct pci_dev *dev) continue; res->start = pcidev_info->pdi_pio_mapped_addr[idx]; - res->end = addr + size; + res->end = res->start + size; /* * if it's already in the device structure, remove it before -- 2.7.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] ia64/PCI: Remove unused 'addr' and fix build warning 2016-05-04 11:17 [PATCH 0/5] ia64: Fix compiler warnings Matt Fleming 2016-05-04 11:17 ` [PATCH 1/5] ia64/PCI: Fix incorrect PCI resource end address Matt Fleming @ 2016-05-04 11:17 ` Matt Fleming 2016-05-04 11:17 ` [PATCH 3/5] ia64: Reduce stack usage by iterating over nodemask Matt Fleming ` (3 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Matt Fleming @ 2016-05-04 11:17 UTC (permalink / raw) To: Tony Luck, Fenghua Yu Cc: Bjorn Helgaas, linux-ia64, linux-kernel, Matt Fleming Ever since commit 240504adaf07 ("ia64/PCI: Keep CPU physical (not virtual) addresses in shadow ROM resource") 'addr' has been unused, resulting in the following compiler warning, arch/ia64/sn/kernel/io_acpi_init.c: In function 'sn_acpi_slot_fixup': arch/ia64/sn/kernel/io_acpi_init.c:429:16: warning: unused variable 'addr' [-Wunused-variable] void __iomem *addr; ^ Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Bjorn Helgaas <helgaas@kernel.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> --- arch/ia64/sn/kernel/io_acpi_init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c index 231234c8d113..c31fe637b0b4 100644 --- a/arch/ia64/sn/kernel/io_acpi_init.c +++ b/arch/ia64/sn/kernel/io_acpi_init.c @@ -426,7 +426,6 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info, void sn_acpi_slot_fixup(struct pci_dev *dev) { - void __iomem *addr; struct pcidev_info *pcidev_info = NULL; struct sn_irq_info *sn_irq_info = NULL; struct resource *res; -- 2.7.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] ia64: Reduce stack usage by iterating over nodemask 2016-05-04 11:17 [PATCH 0/5] ia64: Fix compiler warnings Matt Fleming 2016-05-04 11:17 ` [PATCH 1/5] ia64/PCI: Fix incorrect PCI resource end address Matt Fleming 2016-05-04 11:17 ` [PATCH 2/5] ia64/PCI: Remove unused 'addr' and fix build warning Matt Fleming @ 2016-05-04 11:17 ` Matt Fleming 2016-05-04 11:17 ` [PATCH 4/5] ia64/traps: Silence GCC warning about uninitialised variable Matt Fleming ` (2 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Matt Fleming @ 2016-05-04 11:17 UTC (permalink / raw) To: Tony Luck, Fenghua Yu Cc: Bjorn Helgaas, linux-ia64, linux-kernel, Matt Fleming GCC complains about sn2_global_tlb_purge() because of the large stack required by the function, arch/ia64/sn/kernel/sn2/sn2_smp.c: In function 'sn2_global_tlb_purge': arch/ia64/sn/kernel/sn2/sn2_smp.c:319:1: warning: the frame size of 2176 bytes is larger than 2048 bytes [-Wframe-larger-than=] 2048 bytes of the stack are consumed by the node ID array 'nasids[]'. But we don't actually need to put the ID array on the stack and can use nodemask operations. Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Bjorn Helgaas <helgaas@kernel.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> --- arch/ia64/sn/kernel/sn2/sn2_smp.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c index f9c8d9fc5939..c98dc965fe82 100644 --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c @@ -54,7 +54,7 @@ sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long); void -sn2_ptc_deadlock_recovery(short *, short, short, int, +sn2_ptc_deadlock_recovery(nodemask_t, short, short, int, volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long); @@ -169,7 +169,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, int use_cpu_ptcga; volatile unsigned long *ptc0, *ptc1; unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value, old_rr = 0; - short nasids[MAX_NUMNODES], nix; + short nix; nodemask_t nodes_flushed; int active, max_active, deadlock, flush_opt = sn2_flush_opt; @@ -218,9 +218,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, } itc = ia64_get_itc(); - nix = 0; - for_each_node_mask(cnode, nodes_flushed) - nasids[nix++] = cnodeid_to_nasid(cnode); + nix = nodes_weight(nodes_flushed); rr_value = (mm->context << 3) | REGION_NUMBER(start); @@ -270,8 +268,10 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, data0 = (data0 & ~SH2_PTC_ADDR_MASK) | (start & SH2_PTC_ADDR_MASK); deadlock = 0; active = 0; - for (ibegin = 0, i = 0; i < nix; i++) { - nasid = nasids[i]; + ibegin = 0; + i = 0; + for_each_node_mask(cnode, nodes_flushed) { + nasid = cnodeid_to_nasid(cnode); if (use_cpu_ptcga && unlikely(nasid = mynasid)) { ia64_ptcga(start, nbits << 2); ia64_srlz_i(); @@ -286,13 +286,14 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, if ((deadlock = wait_piowc())) { if (flush_opt = 1) goto done; - sn2_ptc_deadlock_recovery(nasids, ibegin, i, mynasid, ptc0, data0, ptc1, data1); + sn2_ptc_deadlock_recovery(nodes_flushed, ibegin, i, mynasid, ptc0, data0, ptc1, data1); if (reset_max_active_on_deadlock()) max_active = 1; } active = 0; ibegin = i + 1; } + i++; } start += (1UL << nbits); } while (start < end); @@ -327,11 +328,12 @@ done: */ void -sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid, +sn2_ptc_deadlock_recovery(nodemask_t nodes, short ib, short ie, int mynasid, volatile unsigned long *ptc0, unsigned long data0, volatile unsigned long *ptc1, unsigned long data1) { short nasid, i; + int cnode; unsigned long *piows, zeroval, n; __this_cpu_inc(ptcstats.deadlocks); @@ -339,17 +341,26 @@ sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid, piows = (unsigned long *) pda->pio_write_status_addr; zeroval = pda->pio_write_status_val; + i = 0; + for_each_node_mask(cnode, nodes) { + if (i < ib) + goto next; + + if (i > ie) + break; - for (i=ib; i <= ie; i++) { - nasid = nasids[i]; + nasid = cnodeid_to_nasid(cnode); if (local_node_uses_ptc_ga(is_shub1()) && nasid = mynasid) - continue; + goto next; + ptc0 = CHANGE_NASID(nasid, ptc0); if (ptc1) ptc1 = CHANGE_NASID(nasid, ptc1); n = sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval); __this_cpu_add(ptcstats.deadlocks2, n); +next: + i++; } } -- 2.7.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] ia64/traps: Silence GCC warning about uninitialised variable 2016-05-04 11:17 [PATCH 0/5] ia64: Fix compiler warnings Matt Fleming ` (2 preceding siblings ...) 2016-05-04 11:17 ` [PATCH 3/5] ia64: Reduce stack usage by iterating over nodemask Matt Fleming @ 2016-05-04 11:17 ` Matt Fleming 2016-05-04 11:17 ` [PATCH 5/5] ia64/unaligned: Silence another GCC warning about an " Matt Fleming 2016-05-05 19:59 ` [PATCH 0/5] ia64: Fix compiler warnings Luck, Tony 5 siblings, 0 replies; 7+ messages in thread From: Matt Fleming @ 2016-05-04 11:17 UTC (permalink / raw) To: Tony Luck, Fenghua Yu Cc: Bjorn Helgaas, linux-ia64, linux-kernel, Matt Fleming arch/ia64/kernel/traps.c: In function 'ia64_fault': arch/ia64/kernel/traps.c:433:17: warning: 'siginfo.si_code' may be used uninitialized in this function [-Wmaybe-uninitialized] struct siginfo siginfo; Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Bjorn Helgaas <helgaas@kernel.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> --- arch/ia64/kernel/traps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c index 6f7d4a4dcf24..77edd68c5161 100644 --- a/arch/ia64/kernel/traps.c +++ b/arch/ia64/kernel/traps.c @@ -548,6 +548,7 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, return; } switch (vector) { + default: case 29: siginfo.si_code = TRAP_HWBKPT; #ifdef CONFIG_ITANIUM -- 2.7.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] ia64/unaligned: Silence another GCC warning about an uninitialised variable 2016-05-04 11:17 [PATCH 0/5] ia64: Fix compiler warnings Matt Fleming ` (3 preceding siblings ...) 2016-05-04 11:17 ` [PATCH 4/5] ia64/traps: Silence GCC warning about uninitialised variable Matt Fleming @ 2016-05-04 11:17 ` Matt Fleming 2016-05-05 19:59 ` [PATCH 0/5] ia64: Fix compiler warnings Luck, Tony 5 siblings, 0 replies; 7+ messages in thread From: Matt Fleming @ 2016-05-04 11:17 UTC (permalink / raw) To: Tony Luck, Fenghua Yu Cc: Bjorn Helgaas, linux-ia64, linux-kernel, Matt Fleming arch/ia64/kernel/unaligned.c: In function 'ia64_handle_unaligned': arch/ia64/kernel/unaligned.c:1385:16: warning: 'u.l' may be used uninitialized in this function [-Wmaybe-uninitialized] opcode = (u.l >> IA64_OPCODE_SHIFT) & IA64_OPCODE_MASK; ^ Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> --- arch/ia64/kernel/unaligned.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c index e7ae6088350a..7f0d31656b4d 100644 --- a/arch/ia64/kernel/unaligned.c +++ b/arch/ia64/kernel/unaligned.c @@ -1378,6 +1378,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) * extract the instruction from the bundle given the slot number */ switch (ipsr->ri) { + default: case 0: u.l = (bundle[0] >> 5); break; case 1: u.l = (bundle[0] >> 46) | (bundle[1] << 18); break; case 2: u.l = (bundle[1] >> 23); break; -- 2.7.3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH 0/5] ia64: Fix compiler warnings 2016-05-04 11:17 [PATCH 0/5] ia64: Fix compiler warnings Matt Fleming ` (4 preceding siblings ...) 2016-05-04 11:17 ` [PATCH 5/5] ia64/unaligned: Silence another GCC warning about an " Matt Fleming @ 2016-05-05 19:59 ` Luck, Tony 5 siblings, 0 replies; 7+ messages in thread From: Luck, Tony @ 2016-05-05 19:59 UTC (permalink / raw) To: Matt Fleming, Yu, Fenghua Cc: Bjorn Helgaas, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org > ia64/PCI: Fix incorrect PCI resource end address > ia64/PCI: Remove unused 'addr' and fix build warning > ia64: Reduce stack usage by iterating over nodemask > ia64/traps: Silence GCC warning about uninitialised variable > ia64/unaligned: Silence another GCC warning about an uninitialized variable Applied all 5. I was a little leery of the two that added "default:" cases to switches ... but I don't see a cleaner way to unconfuse the compiler without a more radical restructuring of the code. Thanks -Tony ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-05-05 19:59 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-05-04 11:17 [PATCH 0/5] ia64: Fix compiler warnings Matt Fleming 2016-05-04 11:17 ` [PATCH 1/5] ia64/PCI: Fix incorrect PCI resource end address Matt Fleming 2016-05-04 11:17 ` [PATCH 2/5] ia64/PCI: Remove unused 'addr' and fix build warning Matt Fleming 2016-05-04 11:17 ` [PATCH 3/5] ia64: Reduce stack usage by iterating over nodemask Matt Fleming 2016-05-04 11:17 ` [PATCH 4/5] ia64/traps: Silence GCC warning about uninitialised variable Matt Fleming 2016-05-04 11:17 ` [PATCH 5/5] ia64/unaligned: Silence another GCC warning about an " Matt Fleming 2016-05-05 19:59 ` [PATCH 0/5] ia64: Fix compiler warnings Luck, Tony
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).