qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Alistair Francis <alistair.francis@xilinx.com>, qemu-devel@nongnu.org
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Fam Zheng <famz@redhat.com>,
	qemu-block@nongnu.org,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	John Snow <jsnow@redhat.com>, Juan Quintela <quintela@redhat.com>,
	armbru@redhat.com, Yongbok Kim <yongbok.kim@imgtec.com>,
	qemu-arm@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	xen-devel@lists.xenproject.org,
	Anthony Perard <anthony.perard@citrix.com>,
	alistair23@gmail.com, Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v1 1/8] Replace all occurances of __FUNCTION__ with __func__
Date: Tue, 26 Sep 2017 08:32:09 -0500	[thread overview]
Message-ID: <1788278d-9437-34a0-4a17-d7914d459f77@redhat.com> (raw)
In-Reply-To: <e9eb34b7a508fbe3b89bb8b8aa8141f018871081.1506384414.git.alistair.francis@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 7049 bytes --]

On 09/25/2017 07:08 PM, Alistair Francis wrote:
> Replace all occurs of __FUNCTION__ except for the check in checkpatch
> with the non GCC specific __func__.
> 
> One line in hcd-musb.c was manually tweaked to pass checkpatch.
> 
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: John Snow <jsnow@redhat.com>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Yongbok Kim <yongbok.kim@imgtec.com>
> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com> (supporter:Block
> Cc: Fam Zheng <famz@redhat.com> (supporter:Block

That looks funny, with no closing ).  Something's breaking down between
get_maintainers.pl and your eventual email, although it's not fatal.

> Cc: Juan Quintela <quintela@redhat.com>
> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> Cc: qemu-arm@nongnu.org
> Cc: qemu-block@nongnu.org
> Cc: xen-devel@lists.xenproject.org
> ---
> 

>  65 files changed, 273 insertions(+), 273 deletions(-)

Big but mechanical, so I'm okay without splitting it further.

> 
> diff --git a/audio/audio_int.h b/audio/audio_int.h
> index 5bcb1c60e1..543b1bd8d5 100644
> --- a/audio/audio_int.h
> +++ b/audio/audio_int.h
> @@ -253,7 +253,7 @@ static inline int audio_ring_dist (int dst, int src, int len)
>  #define AUDIO_STRINGIFY(n) AUDIO_STRINGIFY_(n)
>  
>  #if defined _MSC_VER || defined __GNUC__
> -#define AUDIO_FUNC __FUNCTION__
> +#define AUDIO_FUNC __func__
>  #else
>  #define AUDIO_FUNC __FILE__ ":" AUDIO_STRINGIFY (__LINE__)
>  #endif

This can be further simplified.  We really aren't using _MSC_VER as our
compiler (can anyone prove me wrong?), and we DO require a C99 compiler
(per C99 6.4.2.2, __func__ support is mandatory), so we don't really
need the #else branch (or, for that matter, we probably don't even need
AUDIO_FUNC).  But to keep this patch mechanical, that can be a separate
followup.

> diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
> index 58005b6619..32687afced 100644
> --- a/hw/arm/nseries.c
> +++ b/hw/arm/nseries.c
> @@ -463,7 +463,7 @@ static uint32_t mipid_txrx(void *opaque, uint32_t cmd, int len)
>      uint8_t ret;
>  
>      if (len > 9) {
> -        hw_error("%s: FIXME: bad SPI word width %i\n", __FUNCTION__, len);
> +        hw_error("%s: FIXME: bad SPI word width %i\n", __func__, len);

Not this patch's problem, but it would probably be simpler if hw_error()
were a macro that automatically prefixed __func__, rather than making
every caller have to supply it themselves.

> +++ b/hw/arm/omap1.c

> @@ -1716,7 +1716,7 @@ static void omap_clkm_write(void *opaque, hwaddr addr,
>      case 0x18:	/* ARM_SYSST */
>          if ((s->clkm.clocking_scheme ^ (value >> 11)) & 7) {
>              s->clkm.clocking_scheme = (value >> 11) & 7;
> -            printf("%s: clocking scheme set to %s\n", __FUNCTION__,
> +            printf("%s: clocking scheme set to %s\n", __func__,
>                              clkschemename[s->clkm.clocking_scheme]);

Worth fixing the indentation while you are here?

> @@ -2473,7 +2473,7 @@ static void omap_pwt_write(void *opaque, hwaddr addr,
>      case 0x04:	/* VRC */
>          if ((value ^ s->vrc) & 1) {
>              if (value & 1)
> -                printf("%s: %iHz buzz on\n", __FUNCTION__, (int)
> +                printf("%s: %iHz buzz on\n", __func__, (int)
>                                  /* 1.5 MHz from a 12-MHz or 13-MHz PWT_CLK */
>                                  ((omap_clk_getrate(s->clk) >> 3) /
>                                   /* Pre-multiplexer divider */

Likewise?

> @@ -3330,13 +3330,13 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr addr,
>          s->mcr[1] = value & 0x03e3;
>          if (value & 3)					/* XMCM */
>              printf("%s: Tx channel selection mode enable attempt\n",
> -                            __FUNCTION__);
> +                            __func__);
>          return;
>      case 0x1a:	/* MCR1 */
>          s->mcr[0] = value & 0x03e1;
>          if (value & 1)					/* RMCM */
>              printf("%s: Rx channel selection mode enable attempt\n",
> -                            __FUNCTION__);
> +                            __func__);

and again


> +++ b/hw/arm/omap2.c
> @@ -1312,7 +1312,7 @@ static void omap_prcm_apll_update(struct omap_prcm_s *s)
>  
>      if (mode[0] == 1 || mode[0] == 2 || mode[1] == 1 || mode[1] == 2)
>          fprintf(stderr, "%s: bad EN_54M_PLL or bad EN_96M_PLL\n",
> -                        __FUNCTION__);
> +                        __func__);

More of the same. I'll quit pointing it out.


> +++ b/hw/block/onenand.c
> @@ -661,12 +661,12 @@ static uint64_t onenand_read(void *opaque, hwaddr addr,
>      case 0xff02:	/* ECC Result of spare area data */
>      case 0xff03:	/* ECC Result of main area data */
>      case 0xff04:	/* ECC Result of spare area data */
> -        hw_error("%s: imeplement ECC\n", __FUNCTION__);
> +        hw_error("%s: imeplement ECC\n", __func__);

Should we fix the typo while here? s/imeplement/implement/

> +++ b/hw/isa/vt82c686.c
> @@ -30,7 +30,7 @@
>  //#define DEBUG_VT82C686B
>  
>  #ifdef DEBUG_VT82C686B
> -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
> +#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARGS__)
>  #else
>  #define DPRINTF(fmt, ...)
>  #endif

Not this patch's problem, but I hate bit-rottable statements.  This
should be fixed separately into a form that always evaluates under
-Wformat (guarded by an if(0) in normal builds).

> diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
> index e8b2eef688..41a7690560 100644
> --- a/hw/mips/gt64xxx_pci.c
> +++ b/hw/mips/gt64xxx_pci.c
> @@ -33,7 +33,7 @@
>  //#define DEBUG
>  
>  #ifdef DEBUG
> -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
> +#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARGS__)
>  #else
>  #define DPRINTF(fmt, ...)
>  #endif

Ditto.


> +++ b/hw/usb/hcd-musb.c
> @@ -253,8 +253,8 @@
>  /* #define MUSB_DEBUG */
>  
>  #ifdef MUSB_DEBUG
> -#define TRACE(fmt,...) fprintf(stderr, "%s@%d: " fmt "\n", __FUNCTION__, \
> -                               __LINE__, ##__VA_ARGS__)
> +#define TRACE(fmt, ...) fprintf(stderr, "%s@%d: " fmt "\n", __func__, \
> +                                __LINE__, ##__VA_ARGS__)
>  #else
>  #define TRACE(...)
>  #endif

and again

My comments were either about things for separate patches, or things
that are trivial if you choose to touch them up, so:

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2017-09-26 13:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26  0:08 [Qemu-devel] [PATCH v1 0/8] Remove some of the fprintf(stderr, "* Alistair Francis
2017-09-26  0:08 ` [Qemu-devel] [PATCH v1 1/8] Replace all occurances of __FUNCTION__ with __func__ Alistair Francis
2017-09-26 13:32   ` Eric Blake [this message]
2017-09-27 22:59     ` Alistair Francis
2017-09-27 23:47     ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2017-09-28 22:37       ` Alistair Francis
2017-09-26  0:08 ` [Qemu-devel] [PATCH v1 2/8] tests: Replace fprintf(stderr, "*\n" with error_report() Alistair Francis
2017-09-26  0:55   ` Emilio G. Cota
2017-09-26 14:03     ` Eric Blake
2017-09-27 23:08     ` Alistair Francis
2017-09-28 17:53       ` Emilio G. Cota
2017-09-26  0:08 ` [Qemu-devel] [PATCH v1 3/8] hw: " Alistair Francis
2017-09-26  3:51   ` Thomas Huth
2017-09-27 22:41     ` Alistair Francis
2017-09-26  0:08 ` [Qemu-devel] [PATCH v1 4/8] block: " Alistair Francis
2017-09-26  0:09 ` [Qemu-devel] [PATCH v1 5/8] util: " Alistair Francis
2017-09-26  0:09 ` [Qemu-devel] [PATCH v1 6/8] ui: " Alistair Francis
2017-09-26  0:09 ` [Qemu-devel] [PATCH v1 7/8] tcg: " Alistair Francis
2017-09-26 15:05   ` Richard Henderson
2017-09-26  0:09 ` [Qemu-devel] [PATCH v1 8/8] target: " Alistair Francis
2017-09-26  4:08   ` Thomas Huth
2017-09-29 18:12     ` Alistair Francis
2017-09-26 15:21   ` Richard Henderson
2017-09-26  0:27 ` [Qemu-devel] [PATCH v1 0/8] Remove some of the fprintf(stderr, "* no-reply
2017-09-26  0:42 ` no-reply
2017-09-26  9:05 ` Stefan Hajnoczi
2017-09-26 16:47   ` Alistair Francis

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=1788278d-9437-34a0-4a17-d7914d459f77@redhat.com \
    --to=eblake@redhat.com \
    --cc=alistair.francis@xilinx.com \
    --cc=alistair23@gmail.com \
    --cc=anthony.perard@citrix.com \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=sstabellini@kernel.org \
    --cc=stefanha@redhat.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yongbok.kim@imgtec.com \
    /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).