* [PATCH 3.13-rc1] xen-blkfront: Silence pfn maybe-uninitialized warning
@ 2013-11-14 21:29 Tim Gardner
2013-11-14 22:24 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 4+ messages in thread
From: Tim Gardner @ 2013-11-14 21:29 UTC (permalink / raw)
To: xen-devel, linux-kernel
Cc: Tim Gardner, Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel
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);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 3.13-rc1] xen-blkfront: Silence pfn maybe-uninitialized warning
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
2013-11-15 12:09 ` Roger Pau Monné
0 siblings, 2 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-11-14 22:24 UTC (permalink / raw)
To: Tim Gardner, xen-devel, linux-kernel
Cc: Boris Ostrovsky, David Vrabel, roger.pau@citrix.com
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.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 3.13-rc1] xen-blkfront: Silence pfn maybe-uninitialized warning
2013-11-14 22:24 ` Konrad Rzeszutek Wilk
@ 2013-11-14 22:54 ` Tim Gardner
2013-11-15 12:09 ` Roger Pau Monné
1 sibling, 0 replies; 4+ messages in thread
From: Tim Gardner @ 2013-11-14 22:54 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, xen-devel, linux-kernel
Cc: Boris Ostrovsky, David Vrabel, roger.pau@citrix.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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 3.13-rc1] xen-blkfront: Silence pfn maybe-uninitialized warning
2013-11-14 22:24 ` Konrad Rzeszutek Wilk
2013-11-14 22:54 ` Tim Gardner
@ 2013-11-15 12:09 ` Roger Pau Monné
1 sibling, 0 replies; 4+ messages in thread
From: Roger Pau Monné @ 2013-11-15 12:09 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, Tim Gardner, xen-devel, linux-kernel
Cc: Boris Ostrovsky, David Vrabel
On 14/11/13 23:24, 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>
Acked-by: Roger Pau Monné <roger.pau@citrix.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?
I'm fine with this patch, although I'm more used to the classic pfn = 0.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-11-15 12:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-11-15 12:09 ` Roger Pau Monné
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox