mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luca <kronos.it@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: "Petri T. Koistinen" <petri.koistinen@iki.fi>,
	xfs-masters@oss.sgi.com, nathans@sgi.com
Subject: Re: [PATCH] fs/xfs/xfs_bmap.c: initialize variable, remove warning
Date: Tue, 2 May 2006 22:54:06 +0200	[thread overview]
Message-ID: <20060502205406.GA9633@dreamland.darkstar.lan> (raw)
In-Reply-To: <Pine.LNX.4.64.0605020015230.5245@joo>

Petri T. Koistinen <petri.koistinen@iki.fi> ha scritto:
> From: Petri T. Koistinen <petri.koistinen@iki.fi>
> 
> Remove warning by initializing uninitialized variable.
> 
> Warning:
>  CC      fs/xfs/xfs_bmap.o
> fs/xfs/xfs_bmap.c: In function 'xfs_bmapi':
> fs/xfs/xfs_bmap.c:2498: warning: 'rtx' is used uninitialized in this function
> 
> Signed-off-by: Petri T. Koistinen <petri.koistinen@iki.fi>
> ---
> fs/xfs/xfs_bmap.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> ---
> diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
> index 26939d3..35bad7b 100644
> --- a/fs/xfs/xfs_bmap.c
> +++ b/fs/xfs/xfs_bmap.c
> @@ -2453,7 +2453,7 @@ xfs_bmap_rtalloc(
> 	xfs_extlen_t	prod = 0;	/* product factor for allocators */
> 	xfs_extlen_t	ralen = 0;	/* realtime allocation length */
> 	xfs_extlen_t	align;		/* minimum allocation alignment */
> -	xfs_rtblock_t	rtx;		/* realtime extent number */
> +	xfs_rtblock_t	rtx = 0;	/* realtime extent number */
> 	xfs_rtblock_t	rtb;
> 
> 	mp = ap->ip->i_mount;


Dump compiler ;)

rtx is initialized by xfs_rtpick_extent(); if xfs_rtpick_extent succedes
then rtx is initialized, if it fails then rtx is never used.

I also see the warning, and I'm compiling without CONFIG_XFS_RT; in this
case xfs_rtpick_extent() is a noop (ENOSYS), gcc really should see that
rtx won't be used. Funny.

Luca
-- 
Home: http://kronoz.cjb.net
Il piu` bel momento dell'amore e` quando ci si illude che duri per 
sempre; il piu` brutto, quando ci si accorge che dura da troppo.

      reply	other threads:[~2006-05-02 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-01 21:17 Petri T. Koistinen
2006-05-02 20:54 ` Luca [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=20060502205406.GA9633@dreamland.darkstar.lan \
    --to=kronos.it@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathans@sgi.com \
    --cc=petri.koistinen@iki.fi \
    --cc=xfs-masters@oss.sgi.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

all inboxes | Powered by JetHome®