[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <528554AC.5080607@canonical.com>
Date: Thu, 14 Nov 2013 14:54:36 -0800
From: Tim Gardner <tim.gardner@...onical.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
CC: Boris Ostrovsky <boris.ostrovsky@...cle.com>,
David Vrabel <david.vrabel@...rix.com>,
"roger.pau@...rix.com" <roger.pau@...rix.com>
Subject: Re: [PATCH 3.13-rc1] xen-blkfront: Silence pfn maybe-uninitialized
warning
On 11/14/2013 02:24 PM, Konrad Rzeszutek Wilk wrote:
> Tim Gardner <tim.gardner@...onical.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@...cle.com> Cc: Boris
>> Ostrovsky <boris.ostrovsky@...cle.com> Cc: David Vrabel
>> <david.vrabel@...rix.com> Signed-off-by: Tim Gardner
>> <tim.gardner@...onical.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@...onical.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists