ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] /fs/ocfs2/slot_map.c (2.6.35.6): Uninitialized variable
@ 2010-09-27 20:28 Poyo VL
  2010-09-28 21:10 ` Mark Fasheh
  2010-10-11 20:47 ` Joel Becker
  0 siblings, 2 replies; 3+ messages in thread
From: Poyo VL @ 2010-09-27 20:28 UTC (permalink / raw)
  To: ocfs2-devel

When I tried to compile I got the following warning:
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.
Patch is downer, I also attached it because there are problems with Yahoo! Mail.

Signed-off-by: Ionut Gabriel Popescu <poyo_vl@yahoo.com>
---

--- a/fs/ocfs2/slot_map.c    2010-09-27 22:27:07.605568537 +0300
+++ b/fs/ocfs2/slot_map.c    2010-09-27 22:27:29.342567489 +0300
@@ -357,7 +357,7 @@ static int ocfs2_map_slot_buffers(struct
 {
     int status = 0;
     u64 blkno;
-    unsigned long long blocks, bytes;
+    unsigned long long blocks, bytes = 0;
     unsigned int i;
     struct buffer_head *bh;


      
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 341 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20100927/b34b17b6/attachment.obj 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH] /fs/ocfs2/slot_map.c (2.6.35.6): Uninitialized variable
  2010-09-27 20:28 [Ocfs2-devel] [PATCH] /fs/ocfs2/slot_map.c (2.6.35.6): Uninitialized variable Poyo VL
@ 2010-09-28 21:10 ` Mark Fasheh
  2010-10-11 20:47 ` Joel Becker
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Fasheh @ 2010-09-28 21:10 UTC (permalink / raw)
  To: ocfs2-devel

On Mon, Sep 27, 2010 at 01:28:37PM -0700, Poyo VL wrote:
> When I tried to compile I got the following warning:
> 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.
> Patch is downer, I also attached it because there are problems with Yahoo! Mail.
> 
> Signed-off-by: Ionut Gabriel Popescu <poyo_vl@yahoo.com>

This looks reasonable, though using uninitialized_var() might be the
preferred method.

Acked-by: Mark Fasheh <mfasheh@suse.com>


--
Mark Fasheh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH] /fs/ocfs2/slot_map.c (2.6.35.6): Uninitialized variable
  2010-09-27 20:28 [Ocfs2-devel] [PATCH] /fs/ocfs2/slot_map.c (2.6.35.6): Uninitialized variable Poyo VL
  2010-09-28 21:10 ` Mark Fasheh
@ 2010-10-11 20:47 ` Joel Becker
  1 sibling, 0 replies; 3+ messages in thread
From: Joel Becker @ 2010-10-11 20:47 UTC (permalink / raw)
  To: ocfs2-devel

On Mon, Sep 27, 2010 at 01:28:37PM -0700, Poyo VL wrote:
> When I tried to compile I got the following warning:
> 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.
> Patch is downer, I also attached it because there are problems with Yahoo! Mail.
> 
> Signed-off-by: Ionut Gabriel Popescu <poyo_vl@yahoo.com>

	This patch is now in the merge-window branch of ocfs2.git.  In
the future, please send patches inline without MIME.

Joel
-- 

"The lawgiver, of all beings, most owes the law allegiance.  He of all
 men should behave as though the law compelled him.  But it is the
 universal weakness of mankind that what we are given to administer we
 presently imagine we own."
        - H.G. Wells

Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-11 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27 20:28 [Ocfs2-devel] [PATCH] /fs/ocfs2/slot_map.c (2.6.35.6): Uninitialized variable Poyo VL
2010-09-28 21:10 ` Mark Fasheh
2010-10-11 20:47 ` Joel Becker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).