Skip to content

Commit

Permalink
xen-blkfront: Silence pfn maybe-uninitialized warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Boris Ostrovsky <[email protected]>
Cc: David Vrabel <[email protected]>
Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Acked-by: Roger Pau Monné <[email protected]>
  • Loading branch information
rtg-canonical authored and konradwilk committed Nov 26, 2013
1 parent f7cb20f commit 427bfe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 427bfe0

Please sign in to comment.