lkml.org 
[lkml]   [2010]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[Patch] compat ioctl: fix some build warnings
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:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2010-02-05 08:09    [W:0.054 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site