Skip to content

Commit

Permalink
When I tried to compile I got the following warning:
Browse files Browse the repository at this point in the history
fs/ocfs2/slot_map.c: In function ‘ocfs2_init_slot_info’:
fs/ocfs2/slot_map.c:360: warning: ‘bytes’ may be used uninitialized in this function
fs/ocfs2/slot_map.c:360: note: ‘bytes’ was declared here
Compiler: gcc version 4.4.3 (GCC) on Mandriva
I'm not sure why this warning occurs, I think compiler don't know that variable
"bytes" is initialized when it is sent by reference to
ocfs2_slot_map_physical_size and it throws that ugly warning.
However, a simple initialization of "bytes" variable with 0 will fix it.

Signed-off-by: Ionut Gabriel Popescu <poyo_vl@yahoo.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
  • Loading branch information
Poyo VL authored and Joel Becker committed Oct 11, 2010
1 parent 9b5cd10 commit f30d44f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ocfs2/slot_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ static int ocfs2_map_slot_buffers(struct ocfs2_super *osb,
{
int status = 0;
u64 blkno;
unsigned long long blocks, bytes;
unsigned long long blocks, bytes = 0;
unsigned int i;
struct buffer_head *bh;

Expand Down

0 comments on commit f30d44f

Please sign in to comment.