lkml.org 
[lkml]   [2010]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] fs/btrfs/ordered-data.c: fixed compiler warnings for using uninitialized variable
From
On Fri, Sep 10, 2010 at 5:42 PM, Frank Morales II <altf2o@gmail.com> wrote:
> >From 1c304defc543738f82ccb18fe10b558dd2098d74 Mon Sep 17 00:00:00 2001
> From: Frank Morales II <altf2o@gmail.com>
> Date: Fri, 10 Sep 2010 07:34:23 -0700
> Subject: [PATCH] fs/btrfs/ordered-data.c: fixed compiler warnings for using uninitialized variable
>
> In the function tree_search, the variable prev was used without first
> being initialized, causing compiler warning messages. Initializing
> prev to NULL resolved the issue.
>
> Kernal patched against: 2.6.36-rc3 (df423dc7)

Signed-of-by: Felipe Contreras <felipe.contreras@gmail.com>

I came up with exactly this patch, but this is my commit message:

Btrfs: fix compilation warning

fs/btrfs/ordered-data.c: In function ‘tree_search’:
fs/btrfs/ordered-data.c:144: warning: ‘prev’ may be used
uninitialized in this function
fs/btrfs/ordered-data.c: In function ‘btrfs_lookup_first_ordered_extent’:
fs/btrfs/ordered-data.c:144: warning: ‘prev’ may be used
uninitialized in this function
fs/btrfs/ordered-data.c:144: note: ‘prev’ was declared here
fs/btrfs/ordered-data.c: In function ‘btrfs_lookup_ordered_extent’:
fs/btrfs/ordered-data.c:144: warning: ‘prev’ may be used
uninitialized in this function
fs/btrfs/ordered-data.c:144: note: ‘prev’ was declared here
fs/btrfs/ordered-data.c: In function ‘btrfs_lookup_ordered_range’:
fs/btrfs/ordered-data.c:144: warning: ‘prev’ may be used
uninitialized in this function
fs/btrfs/ordered-data.c:144: note: ‘prev’ was declared here
fs/btrfs/ordered-data.c: In function ‘btrfs_dec_test_ordered_pending’:
fs/btrfs/ordered-data.c:144: warning: ‘prev’ may be used
uninitialized in this function
fs/btrfs/ordered-data.c:144: note: ‘prev’ was declared here

__tree_search() might not set &prev.

--
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-09-12 12:39    [W:0.133 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site