linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ubifs: Fix build warning
@ 2012-06-25 20:47 Alexandre Pereira da Silva
  2012-06-29 11:07 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Pereira da Silva @ 2012-06-25 20:47 UTC (permalink / raw)
  Cc: Alexandre Pereira da Silva, Artem Bityutskiy, Adrian Hunter,
	linux-mtd, linux-kernel

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


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

* Re: [PATCH v2] ubifs: Fix build warning
  2012-06-25 20:47 [PATCH v2] ubifs: Fix build warning Alexandre Pereira da Silva
@ 2012-06-29 11:07 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2012-06-29 11:07 UTC (permalink / raw)
  To: Alexandre Pereira da Silva; +Cc: Adrian Hunter, linux-mtd, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

On Mon, 2012-06-25 at 17:47 -0300, Alexandre Pereira da Silva wrote:
>  #include "ubifs.h"
> +#include <linux/compiler.h>

This is not needed, I've removed this chunk and pushed to
linux-ubifs.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-06-29 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25 20:47 [PATCH v2] ubifs: Fix build warning Alexandre Pereira da Silva
2012-06-29 11:07 ` Artem Bityutskiy

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).