lkml.org 
[lkml]   [2012]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] ubifs: Fix build warning
Date
Fix:
fs/ubifs/dir.c: In function 'ubifs_rename':
fs/ubifs/dir.c:972:15: warning: 'saved_nlink' may be used uninitialized
in this function

Use gcc uninitialized_var macro to avoid bogus warning

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
---
Applies to v3.5-rc4

Changes since v1:
Use uninitialized_var macro

fs/ubifs/dir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index a6d42ef..40c2d04 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -41,6 +41,7 @@
*/

#include "ubifs.h"
+#include <linux/compiler.h>

/**
* inherit_flags - inherit flags of the parent inode.
@@ -969,7 +970,7 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct ubifs_budget_req ino_req = { .dirtied_ino = 1,
.dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) };
struct timespec time;
- unsigned int saved_nlink;
+ unsigned int uninitialized_var(saved_nlink);

/*
* Budget request settings: deletion direntry, new direntry, removing
--
1.7.10


\
 
 \ /
  Last update: 2012-06-25 23:21    [W:0.038 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site