qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	qemu-block@nongnu.org, "Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>, "Warner Losh" <imp@bsdimp.com>,
	"Kyle Evans" <kevans@freebsd.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Paul Durrant" <paul@xen.org>, "Cédric Le Goater" <clg@kaod.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	"Joel Stanley" <joel@jms.id.au>,
	"Tyrone Ting" <kfting@nuvoton.com>,
	"Hao Wu" <wuhaotsh@google.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Stefan Weil" <sw@weilnetz.de>,
	"Riku Voipio" <riku.voipio@iki.fi>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	xen-devel@lists.xenproject.org, kvm@vger.kernel.org
Subject: Re: [PATCH-for-8.1 4/5] bulk: Do not declare function prototypes using extern keyword
Date: Mon, 20 Mar 2023 15:23:38 +0100	[thread overview]
Message-ID: <cdf53d5e-d74d-9316-f1bc-3efc36e1c3bc@linaro.org> (raw)
In-Reply-To: <ZBhkIjelEtR7lckj@redhat.com>

On 20/3/23 14:48, Daniel P. Berrangé wrote:
> On Mon, Mar 20, 2023 at 02:42:18PM +0100, Philippe Mathieu-Daudé wrote:
>> By default, C function prototypes declared in headers are visible,
>> so there is no need to declare them as 'extern' functions.
>> Remove this redundancy in a single bulk commit; do not modify:
>>
>>    - meson.build (used to check function availability at runtime)
>>    - pc-bios
>>    - libdecnumber
>>    - *.c
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   block/dmg.h                    |  8 +++----
>>   bsd-user/bsd-file.h            |  6 ++---
>>   crypto/hmacpriv.h              | 13 +++++------
>>   hw/xen/xen_pt.h                |  8 +++----
>>   include/crypto/secret_common.h | 14 +++++-------
>>   include/exec/page-vary.h       |  4 ++--
>>   include/hw/misc/aspeed_scu.h   |  2 +-
>>   include/hw/nvram/npcm7xx_otp.h |  4 ++--
>>   include/hw/qdev-core.h         |  4 ++--
>>   include/qemu/crc-ccitt.h       |  4 ++--
>>   include/qemu/osdep.h           |  2 +-
>>   include/qemu/rcu.h             | 14 ++++++------
>>   include/qemu/sys_membarrier.h  |  4 ++--
>>   include/qemu/uri.h             |  6 ++---
>>   include/sysemu/accel-blocker.h | 14 ++++++------
>>   include/sysemu/os-win32.h      |  4 ++--
>>   include/user/safe-syscall.h    |  4 ++--
>>   target/i386/sev.h              |  6 ++---
>>   target/mips/cpu.h              |  4 ++--
>>   tcg/tcg-internal.h             |  4 ++--
>>   tests/tcg/minilib/minilib.h    |  2 +-
>>   include/exec/memory_ldst.h.inc | 42 +++++++++++++++++-----------------
>>   roms/seabios                   |  2 +-
> 
> Accidental submodule commit.,
> 
>>   23 files changed, 84 insertions(+), 91 deletions(-)
>>
>> diff --git a/block/dmg.h b/block/dmg.h
>> index e488601b62..ed209b5dec 100644
>> --- a/block/dmg.h
>> +++ b/block/dmg.h
>> @@ -51,10 +51,10 @@ typedef struct BDRVDMGState {
>>       z_stream zstream;
>>   } BDRVDMGState;
>>   
>> -extern int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
>> -                                 char *next_out, unsigned int avail_out);
>> +int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
>> +                          char *next_out, unsigned int avail_out);
>>   
>> -extern int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
>> -                                   char *next_out, unsigned int avail_out);
>> +int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
>> +                            char *next_out, unsigned int avail_out);
> 
> These are variable declarations, so with this change you'll get multiple
> copies of the variable if this header is included from multiple source
> files. IOW, the 'extern' usage is correct.

Doh indeed, good catch, thanks.

>> diff --git a/roms/seabios b/roms/seabios
>> index ea1b7a0733..3208b098f5 160000
>> --- a/roms/seabios
>> +++ b/roms/seabios
>> @@ -1 +1 @@
>> -Subproject commit ea1b7a0733906b8425d948ae94fba63c32b1d425
>> +Subproject commit 3208b098f51a9ef96d0dfa71d5ec3a3eaec88f0a
> 
> Nope !

Oops...



  reply	other threads:[~2023-03-20 14:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 13:42 [PATCH-for-8.1 0/5] bulk: Do not declare function prototypes using 'extern' keyword Philippe Mathieu-Daudé
2023-03-20 13:42 ` [PATCH-for-8.1 1/5] qemu/osdep.h: Do not declare function prototypes using extern keyword Philippe Mathieu-Daudé
2023-03-20 13:42 ` [PATCH-for-8.1 2/5] block/dmg: Remove duplicated prototype declarations Philippe Mathieu-Daudé
2023-03-20 13:50   ` Daniel P. Berrangé
2023-03-20 13:42 ` [PATCH-for-8.1 3/5] qemu/uri: Use QueryParams type definition Philippe Mathieu-Daudé
2023-03-20 13:42 ` [PATCH-for-8.1 4/5] bulk: Do not declare function prototypes using extern keyword Philippe Mathieu-Daudé
2023-03-20 13:48   ` Daniel P. Berrangé
2023-03-20 14:23     ` Philippe Mathieu-Daudé [this message]
2023-03-20 13:42 ` [PATCH-for-8.1 5/5] bulk: Replace __attribute__((noreturn)) -> G_NORETURN Philippe Mathieu-Daudé
2023-03-21 12:56   ` Juan Quintela

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=cdf53d5e-d74d-9316-f1bc-3efc36e1c3bc@linaro.org \
    --to=philmd@linaro.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=andrew@aj.id.au \
    --cc=anthony.perard@citrix.com \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=clg@kaod.org \
    --cc=eduardo@habkost.net \
    --cc=hreitz@redhat.com \
    --cc=imp@bsdimp.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=joel@jms.id.au \
    --cc=kevans@freebsd.org \
    --cc=kfting@nuvoton.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    --cc=sstabellini@kernel.org \
    --cc=sw@weilnetz.de \
    --cc=wuhaotsh@google.com \
    --cc=xen-devel@lists.xenproject.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).