[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables
From: |
Jim Meyering |
Subject: |
[Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables |
Date: |
Mon, 21 May 2012 12:03:08 +0200 |
From: Jim Meyering <address@hidden>
I noticed this commit,
virtio-pci: add missing 'static'
which made this change:
> -const MemoryRegionPortio virtio_portio[] = {
> +static const MemoryRegionPortio virtio_portio[] = {
and wondered if there were other variables like that.
The following command shows that there are:
[note that there are probably more: this finds only those
for which the variable name appears in only one source file. ]
$ for i in $(nm -e *.o|sed -n 's/.* [BCDGRS] //p'); do \
test $(git grep -lw $i|wc -l) = 1 && echo $i;done
BlockDeviceIoStatus_lookup
SpiceQueryMouseMode_lookup
qemu_boot_opts
qemu_option_rom_opts
vmstate_info_scsi_requests
xen_xcg
The *_lookup names are false positives, since the symbols are actually
used from two or more .o files. Here are patches for the others:
Jim Meyering (3):
xen: remove unused global, xen_xcg
scsi: declare vmstate_info_scsi_requests to be static
qemu-config: qemu_option_rom_opts, qemu_boot_opts: declare static
hw/scsi-bus.c | 2 +-
hw/xen_backend.c | 1 -
qemu-config.c | 4 ++--
3 files changed, 3 insertions(+), 4 deletions(-)
--
1.7.10.2.552.gaa3bb87
- [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables,
Jim Meyering <=
- [Qemu-devel] [PATCH 1/3] xen: remove unused global, xen_xcg, Jim Meyering, 2012/05/21
- [Qemu-devel] [PATCH 2/3] scsi: declare vmstate_info_scsi_requests to be static, Jim Meyering, 2012/05/21
- [Qemu-devel] [PATCH 3/3] qemu-config: qemu_option_rom_opts, qemu_boot_opts: declare static, Jim Meyering, 2012/05/21
- Re: [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables, Blue Swirl, 2012/05/21