All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] RISC-V: Work towards enabling -Wshadow=local
@ 2023-09-25  4:30 Alistair Francis
  2023-09-25  4:30 ` [PATCH 1/4] hw/riscv: opentitan: Fixup local variables shadowing Alistair Francis
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Alistair Francis @ 2023-09-25  4:30 UTC (permalink / raw)
  To: david, qemu-riscv, qemu-devel
  Cc: bmeng.cn, alistair.francis, Liu Zhiwei, palmer, alistair23,
	dbarboza, Alistair Francis, liweiwei, Bin Meng

Local variables shadowing other local variables or parameters make the
code needlessly hard to understand.  Bugs love to hide in such code.
Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail
on polling error".

This patch removes the local variable shadowing. Tested by adding:

    --extra-cflags='-Wshadow=local -Wno-error=shadow=local -Wno-error=shadow=compatible-local'

To configure

Alistair Francis (4):
  hw/riscv: opentitan: Fixup local variables shadowing
  target/riscv: cpu: Fixup local variables shadowing
  target/riscv: vector_helper: Fixup local variables shadowing
  softmmu/device_tree: Fixup local variables shadowing

 hw/riscv/opentitan.c         | 2 +-
 softmmu/device_tree.c        | 6 +++---
 target/riscv/cpu.c           | 4 ++--
 target/riscv/vector_helper.c | 7 ++++---
 4 files changed, 10 insertions(+), 9 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-09-29  6:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-25  4:30 [PATCH 0/4] RISC-V: Work towards enabling -Wshadow=local Alistair Francis
2023-09-25  4:30 ` [PATCH 1/4] hw/riscv: opentitan: Fixup local variables shadowing Alistair Francis
2023-09-25  9:08   ` Daniel Henrique Barboza
2023-09-25  4:30 ` [PATCH 2/4] target/riscv: cpu: " Alistair Francis
2023-09-25  9:09   ` Daniel Henrique Barboza
2023-09-25  4:30 ` [PATCH 3/4] target/riscv: vector_helper: " Alistair Francis
2023-09-25  9:09   ` Daniel Henrique Barboza
2023-09-25  4:30 ` [PATCH 4/4] softmmu/device_tree: " Alistair Francis
2023-09-25  9:10   ` Daniel Henrique Barboza
2023-09-25  9:11 ` [PATCH 0/4] RISC-V: Work towards enabling -Wshadow=local Daniel Henrique Barboza
2023-09-29  6:56   ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.