qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: Jim Meyering <jim@meyering.net>
Cc: Jim Meyering <meyering@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables
Date: Mon, 21 May 2012 17:51:39 +0000	[thread overview]
Message-ID: <CAAu8pHu9QfCCm4M-M4AkVHd+U75HE1vj4yUS8CEUcuqjpocChQ@mail.gmail.com> (raw)
In-Reply-To: <1337594591-19309-1-git-send-email-jim@meyering.net>

On Mon, May 21, 2012 at 10:03 AM, Jim Meyering <jim@meyering.net> wrote:
> 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. ]

Also, only for files at the top level. What about functions? ;-)

>
>    $ 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

  parent reply	other threads:[~2012-05-21 17:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Blue Swirl [this message]
2012-05-21 18:10   ` [Qemu-devel] [PATCH 0/3] tighten scope of accidentally global variables Jim Meyering
2012-05-21 18:34     ` Blue Swirl
2012-05-21 18:41       ` Jim Meyering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAu8pHu9QfCCm4M-M4AkVHd+U75HE1vj4yUS8CEUcuqjpocChQ@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=jim@meyering.net \
    --cc=meyering@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).