public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] compat ioctl: fix some build warnings
@ 2010-02-05  7:05 Amerigo Wang
  2010-02-05 22:01 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Amerigo Wang @ 2010-02-05  7:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Viro, akpm, Arnd Bergmann, Amerigo Wang

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

I got these warnings:

fs/compat_ioctl.c: In function ‘compat_sys_ioctl':
fs/compat_ioctl.c:534: warning: ‘karg' may be used uninitialized in this function
fs/compat_ioctl.c:533: warning: ‘kcmd' may be used uninitialized in this function
fs/compat_ioctl.c:656: warning: ‘ret' may be used uninitialized in this function

These warnings are harmless, so just shut gcc up.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>

---
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index c5c45de..2468f80 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -543,6 +543,8 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, void __user *argp)
 		kcmd = MTIOCGET;
 		karg = &get;
 		break;
+	default:
+		return -EINVAL;
 	}
 	set_fs (KERNEL_DS);
 	err = sys_ioctl (fd, kcmd, (unsigned long)karg);
@@ -653,7 +655,7 @@ static int set_raw32_request(struct raw_config_request *req, struct raw32_config
 static int raw_ioctl(unsigned fd, unsigned cmd,
 		struct raw32_config_request __user *user_req)
 {
-        int ret;
+        int ret = -EINVAL;
 
         switch (cmd) {
         case RAW_SETBIND:

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

end of thread, other threads:[~2010-02-08  2:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-05  7:05 [Patch] compat ioctl: fix some build warnings Amerigo Wang
2010-02-05 22:01 ` Andrew Morton
2010-02-06  8:58   ` Arnd Bergmann
2010-02-08  2:56   ` Cong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox