public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Gardner <tim.gardner@canonical.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	"roger.pau@citrix.com" <roger.pau@citrix.com>
Subject: Re: [PATCH 3.13-rc1] xen-blkfront: Silence pfn maybe-uninitialized warning
Date: Thu, 14 Nov 2013 14:54:36 -0800	[thread overview]
Message-ID: <528554AC.5080607@canonical.com> (raw)
In-Reply-To: <17a2e4ab-d2dc-4bcc-a0fc-1eb1172876e5@email.android.com>

On 11/14/2013 02:24 PM, Konrad Rzeszutek Wilk wrote:
> Tim Gardner <tim.gardner@canonical.com> wrote:
>> pfn cannot actually be used unless (!info->feature_persistent), nor
>> is pfn accessed in get_grant() unless (!info->feature_persistent),
>> but silence this warning anyway. gcc-4.8
>> 
>> drivers/block/xen-blkfront.c: In function 'do_blkif_request': 
>> drivers/block/xen-blkfront.c:508:20: warning: 'pfn' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized] 
>> gnt_list_entry = get_grant(&gref_head, pfn, info); ^ 
>> drivers/block/xen-blkfront.c:492:19: note: 'pfn' was declared here 
>> unsigned long pfn;
>> 
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Boris
>> Ostrovsky <boris.ostrovsky@oracle.com> Cc: David Vrabel
>> <david.vrabel@citrix.com> Signed-off-by: Tim Gardner
>> <tim.gardner@canonical.com> --- drivers/block/xen-blkfront.c |    2
>> +- 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/block/xen-blkfront.c 
>> b/drivers/block/xen-blkfront.c index 432db1b..5f926de 100644 ---
>> a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c 
>> @@ -489,7 +489,7 @@ static int blkif_queue_request(struct request
>> *req)
>> 
>> if ((ring_req->operation == BLKIF_OP_INDIRECT) && (i %
>> SEGS_PER_INDIRECT_FRAME == 0)) { -				unsigned long pfn; +
>> unsigned long uninitialized_var(pfn);
>> 
>> if (segments) kunmap_atomic(segments);
> 
> I have a similar patch from Roger that sets pfn=0.
> 
> Roger could you repost your patch please or if you feel that this
> patch makes sense then comment on it?
> 
> Thanks.
> 

The advantage of uninitialized_var() is that it doesn't actually
generate any code (or so it says in the header).

rtg
-- 
Tim Gardner tim.gardner@canonical.com

  reply	other threads:[~2013-11-14 22:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 21:29 [PATCH 3.13-rc1] xen-blkfront: Silence pfn maybe-uninitialized warning Tim Gardner
2013-11-14 22:24 ` Konrad Rzeszutek Wilk
2013-11-14 22:54   ` Tim Gardner [this message]
2013-11-15 12:09   ` Roger Pau Monné

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=528554AC.5080607@canonical.com \
    --to=tim.gardner@canonical.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roger.pau@citrix.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