From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA55DCE7A8C for ; Sat, 23 Sep 2023 07:23:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjwyV-0004tl-B5; Sat, 23 Sep 2023 03:22:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjwyT-0004sR-FK for qemu-devel@nongnu.org; Sat, 23 Sep 2023 03:22:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjwyR-00013c-C3 for qemu-devel@nongnu.org; Sat, 23 Sep 2023 03:22:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695453762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l+3QMfxhf69We6jQBSoRgGQetOF6uu6pM3U1q6y4vlQ=; b=S9iqxBZyz5dJygAttQMHeRRRZvmc6UAAwPjF9DFR1FFPyj8helYkDX6qX63ZM5VYe3wxd1 Y0pWFV//N//0GsjqbPRgAn2ZKtRX2Pa5B3lI79MTBbaLi8PGvyxMK5kllu8/5y8CBeWyIL 53pKPhf3qZ/ETR2fd0JZ3PElguVR5bo= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-576-0aid-6PmPO6swUmSsogqTw-1; Sat, 23 Sep 2023 03:22:36 -0400 X-MC-Unique: 0aid-6PmPO6swUmSsogqTw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55B6C1C0759D; Sat, 23 Sep 2023 07:22:35 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F147710F1BE7; Sat, 23 Sep 2023 07:22:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0C66121E6900; Sat, 23 Sep 2023 09:22:32 +0200 (CEST) From: Markus Armbruster To: Markus Armbruster Cc: qemu-devel@nongnu.org, Alberto Garcia , Alistair Francis , Andrew Jeffery , Ani Sinha , Brian Cain , =?utf-8?Q?C=C3=A9dric?= Le Goater , Daniel Henrique Barboza , Daniel P. Berrange , David Gibson , Eduardo Habkost , Eric Auger , Eric Blake , Fam Zheng , Fan Ni , Gerd Hoffmann , Igor Mammedov , Jason Wang , Joel Stanley , Jonathan Cameron , Keith Busch , Klaus Jensen , Laurent Vivier , Laurent Vivier , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Marcel Apfelbaum , Marcelo Tosatti , Michael S. Tsirkin , Nicholas Piggin , Paolo Bonzini , Peter Maydell , Peter Xu , Richard Henderson , Song Gao , Thomas Huth , Vladimir Sementsov-Ogievskiy , Xiaojuan Yang , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: Re: Help wanted for enabling -Wshadow=local References: <87r0mqlf9x.fsf@pond.sub.org> <87jzsho1wn.fsf@pond.sub.org> Date: Sat, 23 Sep 2023 09:22:32 +0200 In-Reply-To: <87jzsho1wn.fsf@pond.sub.org> (Markus Armbruster's message of "Sat, 23 Sep 2023 08:10:32 +0200") Message-ID: <878r8xmk07.fsf@pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Markus Armbruster writes: > Markus Armbruster writes: > >> If you are in To:, we need your help to enable -Wshadow=3Dlocal. >> >> 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". >> >> Enabling -Wshadow would prevent bugs like this one. But we have to >> clean up all the offenders first. >> >> I collected the patches posted so far: >> >> [PATCH v3 0/7] Steps towards enabling -Wshadow=3Dlocal >> Message-ID: <20230921121312.1301864-1-armbru@redhat.com> >> >> [PATCH v2 00/22] (few more) Steps towards enabling -Wshadow >> Message-ID: <20230904161235.84651-1-philmd@linaro.org> >> >> [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] >> Message-ID: <20230904162824.85385-1-philmd@linaro.org> >> >> [PATCH 0/8] ppc: Clean up local variable shadowing >> Message-ID: <20230918145850.241074-1-clg@kaod.org> >> >> Thanks, Philippe & Cedric! > > Collected since: > > [PATCH] test-throttle: don't shadow 'index' variable in do_test_acc= ounting() > Message-Id: <20230922105742.81317-1-berto@igalia.com> > > [PATCH] hw/acpi: changes towards enabling -Wshadow=3Dlocal > Message-Id: <20230922124203.127110-1-anisinha@redhat.com> > > [PATCH 0/4] arm: fix some -Wshadow warnings > Message-Id: <20230922152944.3583438-1-peter.maydell@linaro.org> > > [PATCH 0/4] aspeed: Clean up local variable shadowing > Message-ID: <20230922155924.1172019-1-clg@kaod.org> > > [PATCH] intel_iommu: Fix shadow local variables on "size" > Message-ID: <20230922160410.138786-1-peterx@redhat.com> > > [PATCH 0/2] remove some variable shadowing > Message-ID: <20230922160644.438631-1-berrange@redhat.com> > > [PATCH] tests/qtest/m48t59-test: Silence compiler warning with -Wsh= adow > Message-ID: <20230922163742.149444-1-thuth@redhat.com> > > Thanks Berto, Ani, Peter, C=C3=A9dric, Peter, Daniel, and Thomas! More: [PATCH] qemu-nbd: changes towards enabling -Wshadow=3Dlocal Message-ID: <20230922205019.2755352-2-eblake@redhat.com> [PATCH] target/ppc: Rename variables to avoid local variable shadow= ing in VUPKPX Message-ID: <20230923071203.1209663-1-clg@kaod.org> Thanks Eric and C=C3=A9dric! >> In my local build with -Wshadow=3Dlocal, warnings remain in just 56 file= s. > > Down to 42. Down to 40. >> Sorted by subsystems, files covered by multiple subsystems marked >> "(*NUMBER*)", files not covered in MAINTAINERS marked (*guess*): >> >> Guest CPU cores (TCG) >> --------------------- >> ARM TCG CPUs >> M: Peter Maydell >> hw/arm/smmuv3-internal.h(*2*) >> hw/arm/smmuv3.c(*2*) > > Subsystem appears clean now. > >> ARM SMMU >> M: Eric Auger >> hw/arm/smmuv3-internal.h(*2*) >> hw/arm/smmuv3.c(*2*) > > Subsystem appears clean now. > >> Hexagon TCG CPUs >> M: Brian Cain >> target/hexagon/gen_helper_funcs.py >> target/hexagon/mmvec/macros.h >> target/hexagon/op_helper.c >> target/hexagon/translate.c >> >> M68K TCG CPUs >> M: Laurent Vivier >> disas/m68k.c >> >> PowerPC TCG CPUs >> M: Nicholas Piggin >> M: Daniel Henrique Barboza >> R: C=C3=A9dric Le Goater >> target/ppc/int_helper.c Subsystem appears clean now. >> RISC-V TCG CPUs >> hw/riscv/opentitan.c(*2*) >> target/riscv/cpu.c >> target/riscv/vector_helper.c >> >> X86 TCG CPUs >> M: Paolo Bonzini >> M: Richard Henderson >> M: Eduardo Habkost >> hw/i386/acpi-build.c(*3*) > > File appears clean now. > >> hw/i386/acpi-microvm.c(*2*) >> hw/i386/intel_iommu.c(*3*) > > File appears clean now. > >> hw/i386/pc.c(*2*) >> hw/i386/x86.c(*2*) >> target/i386/cpu.c(*guess*) >> target/i386/tcg/seg_helper.c >> target/i386/tcg/sysemu/svm_helper.c >> target/i386/tcg/translate.c >> >> Guest CPU Cores (KVM) >> --------------------- >> X86 KVM CPUs >> M: Paolo Bonzini >> M: Marcelo Tosatti >> target/i386/kvm/kvm.c >> >> ARM Machines >> ------------ >> ARM cores >> M: Peter Maydell >> hw/intc/arm_gicv3_its.c > > Subsystem appears clean now. > >> Versatile PB >> M: Peter Maydell >> hw/misc/arm_sysctl.c > > Subsystem appears clean now. > >> ASPEED BMCs >> M: C=C3=A9dric Le Goater >> M: Peter Maydell >> R: Andrew Jeffery >> R: Joel Stanley >> hw/i2c/aspeed_i2c.c >> hw/misc/aspeed_i3c.c > > Subsystem appears clean now. > >> LoongArch Machines >> ------------------ >> Virt >> M: Xiaojuan Yang >> M: Song Gao >> hw/loongarch/virt.c >> >> RISC-V Machines >> --------------- >> OpenTitan >> M: Alistair Francis >> hw/riscv/opentitan.c(*2*) >> >> X86 Machines >> ------------ >> PC >> M: Michael S. Tsirkin >> M: Marcel Apfelbaum >> hw/i386/acpi-build.c(*3*) > > File appears clean now. > >> hw/i386/acpi-microvm.c(*2*) >> hw/i386/intel_iommu.c(*3*) > > File appears clean now. > >> hw/i386/pc.c(*2*) >> hw/i386/x86.c(*2*) >> >> PC Chipset >> M: Michael S. Tsirkin >> M: Paolo Bonzini >> hw/i2c/pm_smbus.c >> >> Devices >> ------- >> ACPI/SMBIOS >> M: Michael S. Tsirkin >> M: Igor Mammedov >> R: Ani Sinha >> hw/acpi/cpu_hotplug.c >> hw/i386/acpi-build.c(*3*) >> hw/smbios/smbios.c > > Subsystem appears clean now. > >> Network devices >> M: Jason Wang >> hw/net/vhost_net.c(*2*) >> >> SCSI >> M: Paolo Bonzini >> R: Fam Zheng >> hw/scsi/mptsas.c >> >> USB >> M: Gerd Hoffmann >> hw/usb/desc.c >> hw/usb/dev-hub.c >> hw/usb/dev-storage.c >> hw/usb/hcd-xhci.c >> hw/usb/host-libusb.c >> >> vhost >> M: Michael S. Tsirkin >> contrib/vhost-user-gpu/vhost-user-gpu.c(*2*) >> contrib/vhost-user-gpu/vugpu.h(*2*) >> hw/net/vhost_net.c(*2*) >> hw/virtio/vhost.c >> >> virtio >> M: Michael S. Tsirkin >> hw/virtio/virtio-pci.c >> include/hw/virtio/virtio-gpu.h(*2*) >> >> nvme >> M: Keith Busch >> M: Klaus Jensen >> hw/nvme/ns.c >> >> virtio-gpu >> M: Gerd Hoffmann >> include/hw/virtio/virtio-gpu.h(*2*) >> >> vhost-user-gpu >> M: Marc-Andr=C3=A9 Lureau >> R: Gerd Hoffmann >> contrib/vhost-user-gpu/vhost-user-gpu.c(*2*) >> contrib/vhost-user-gpu/vugpu.h(*2*) >> >> Subsystems >> ---------- >> Overall Audio backends >> M: Gerd Hoffmann >> M: Marc-Andr=C3=A9 Lureau >> audio/audio.c >> >> Open Sound System (OSS) Audio backend >> M: Gerd Hoffmann >> audio/ossaudio.c >> >> Compute Express Link >> M: Jonathan Cameron >> R: Fan Ni >> include/hw/cxl/cxl_device.h >> >> Device Tree >> M: Alistair Francis >> R: David Gibson >> softmmu/device_tree.c >> >> Dump >> M: Marc-Andr=C3=A9 Lureau >> dump/dump.c >> >> Main loop >> M: Paolo Bonzini >> softmmu/vl.c >> >> qtest >> M: Thomas Huth >> M: Laurent Vivier >> R: Paolo Bonzini >> tests/qtest/m48t59-test.c > > Subsystem appears clean now. > >> Seccomp >> M: Daniel P. Berrange >> softmmu/qemu-seccomp.c >> >> Cryptography >> M: Daniel P. Berrange >> crypto/tls-cipher-suites.c > > Subsystem appears clean now. > >> Throttling infrastructure >> M: Alberto Garcia >> tests/unit/test-throttle.c > > Subsystem appears clean now. > >> VT-d Emulation >> M: Michael S. Tsirkin >> M: Peter Xu >> R: Jason Wang >> hw/i386/intel_iommu.c(*3*) > > Subsystem appears clean now. > >> Usermode Emulation >> ------------------ >> Linux user >> M: Laurent Vivier >> linux-user/flatload.c >> linux-user/mmap.c >> linux-user/syscall.c >> >> Block drivers >> ------------- >> Network Block Device (NBD) >> M: Eric Blake >> M: Vladimir Sementsov-Ogievskiy >> qemu-nbd.c Subsystem appears clean now.