diff mbox

[U-Boot] fs/reiserfs/reiserfs.c: Fix compiler warning

Message ID 1323695777-4107-1-git-send-email-agust@denx.de
State Accepted
Headers show

Commit Message

Anatolij Gustschin Dec. 12, 2011, 1:16 p.m. UTC
Fix:
reiserfs.c: In function 'reiserfs_mount':
reiserfs.c:360:22: warning: dereferencing type-punned pointer
will break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
Note:
 - checkpatch warnings intentionally not fixed to preserve
   coding style used in the file. Otherwise it would look
   ugly.

 fs/reiserfs/reiserfs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Wolfgang Denk Dec. 12, 2011, 1:25 p.m. UTC | #1
Dear Anatolij Gustschin,

In message <1323695777-4107-1-git-send-email-agust@denx.de> you wrote:
> Fix:
> reiserfs.c: In function 'reiserfs_mount':
> reiserfs.c:360:22: warning: dereferencing type-punned pointer
> will break strict-aliasing rules [-Wstrict-aliasing]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
> Note:
>  - checkpatch warnings intentionally not fixed to preserve
>    coding style used in the file. Otherwise it would look
>    ugly.
> 
>  fs/reiserfs/reiserfs.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/fs/reiserfs/reiserfs.c b/fs/reiserfs/reiserfs.c
index d84fb20..efab8fa 100644
--- a/fs/reiserfs/reiserfs.c
+++ b/fs/reiserfs/reiserfs.c
@@ -282,6 +282,7 @@  reiserfs_mount (unsigned part_length)
 {
   struct reiserfs_super_block super;
   int superblock = REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS;
+  char *cache;
 
   if (part_length < superblock + (sizeof (super) >> SECTOR_BITS)
       || ! reiserfs_devread (superblock, 0, sizeof (struct reiserfs_super_block),
@@ -357,7 +358,8 @@  reiserfs_mount (unsigned part_length)
   if (! block_read (sb_root_block(&super), 0, INFO->blocksize, (char*) ROOT))
     return 0;
 
-  INFO->tree_depth = __le16_to_cpu(BLOCKHEAD (ROOT)->blk_level);
+  cache = ROOT;
+  INFO->tree_depth = __le16_to_cpu(BLOCKHEAD (cache)->blk_level);
 
 #ifdef REISERDEBUG
   printf ("root read_in: block=%d, depth=%d\n",