All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, hreitz@redhat.com,
	edgar.iglesias@amd.com, qemu-block@nongnu.org
Subject: Re: [PATCH v1 1/1] block/file-posix: Avoid maybe-uninitialized warning
Date: Mon, 23 Sep 2024 18:06:25 +0200	[thread overview]
Message-ID: <ZvGSAWV6cgFDHgAf@zapote> (raw)
In-Reply-To: <xk2z73avp7eobweubmma4oefeo2siwm2zhzbpecl4y3qv2ohq5@j7oodpli5sij>

Ping!

On Wed, Aug 14, 2024 at 01:15:55PM -0500, Eric Blake wrote:
> On Mon, Aug 12, 2024 at 04:43:23PM GMT, Edgar E. Iglesias wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > 
> > Avoid a maybe-uninitialized warning in raw_refresh_zoned_limits()
> > by initializing zoned.
> > 
> > With GCC 14.1.0:
> > In function ‘raw_refresh_zoned_limits’,
> >     inlined from ‘raw_refresh_limits’ at ../qemu/block/file-posix.c:1522:5:
> > ../qemu/block/file-posix.c:1405:17: error: ‘zoned’ may be used uninitialized [-Werror=maybe-uninitialized]
> >  1405 |     if (ret < 0 || zoned == BLK_Z_NONE) {
> >       |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
> > ../qemu/block/file-posix.c:1401:20: note: ‘zoned’ was declared here
> >  1401 |     BlockZoneModel zoned;
> >       |                    ^~~~~
> > cc1: all warnings being treated as errors
> > 
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > ---
> >  block/file-posix.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>
> 
> > 
> > diff --git a/block/file-posix.c b/block/file-posix.c
> > index ff928b5e85..90fa54352c 100644
> > --- a/block/file-posix.c
> > +++ b/block/file-posix.c
> > @@ -1398,7 +1398,7 @@ static void raw_refresh_zoned_limits(BlockDriverState *bs, struct stat *st,
> >                                       Error **errp)
> >  {
> >      BDRVRawState *s = bs->opaque;
> > -    BlockZoneModel zoned;
> > +    BlockZoneModel zoned = BLK_Z_NONE;
> >      int ret;
> >  
> >      ret = get_sysfs_zoned_model(st, &zoned);
> > -- 
> > 2.43.0
> > 
> > 
> 
> -- 
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.
> Virtualization:  qemu.org | libguestfs.org
> 


      reply	other threads:[~2024-09-23 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 14:43 [PATCH v1 0/1] block/file-posix: Avoid maybe-uninitialized warning Edgar E. Iglesias
2024-08-12 14:43 ` [PATCH v1 1/1] " Edgar E. Iglesias
2024-08-14 18:15   ` Eric Blake
2024-09-23 16:06     ` Edgar E. Iglesias [this message]

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=ZvGSAWV6cgFDHgAf@zapote \
    --to=edgar.iglesias@gmail.com \
    --cc=eblake@redhat.com \
    --cc=edgar.iglesias@amd.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.