qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables
@ 2012-05-21 10:03 Jim Meyering
  2012-05-21 10:03 ` [Qemu-devel] [PATCH 1/3] xen: remove unused global, xen_xcg Jim Meyering
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jim Meyering @ 2012-05-21 10:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jim Meyering, Blue Swirl

From: Jim Meyering <meyering@redhat.com>

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

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

end of thread, other threads:[~2012-05-21 18:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-21 10:03 [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables Jim Meyering
2012-05-21 10:03 ` [Qemu-devel] [PATCH 1/3] xen: remove unused global, xen_xcg Jim Meyering
2012-05-21 10:18   ` Stefano Stabellini
2012-05-21 10:03 ` [Qemu-devel] [PATCH 2/3] scsi: declare vmstate_info_scsi_requests to be static Jim Meyering
2012-05-21 10:03 ` [Qemu-devel] [PATCH 3/3] qemu-config: qemu_option_rom_opts, qemu_boot_opts: declare static Jim Meyering
2012-05-21 17:51 ` [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables Blue Swirl
2012-05-21 18:10   ` Jim Meyering
2012-05-21 18:34     ` Blue Swirl
2012-05-21 18:41       ` Jim Meyering

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).