public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Amerigo Wang <amwang@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	akpm@linux-foundation.org, Arnd Bergmann <arnd@arndb.de>,
	Amerigo Wang <amwang@redhat.com>
Subject: [Patch] compat ioctl: fix some build warnings
Date: Fri, 5 Feb 2010 02:05:56 -0500	[thread overview]
Message-ID: <20100205070921.4179.39579.sendpatchset@localhost.localdomain> (raw)

[-- 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:

             reply	other threads:[~2010-02-05  7:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05  7:05 Amerigo Wang [this message]
2010-02-05 22:01 ` [Patch] compat ioctl: fix some build warnings Andrew Morton
2010-02-06  8:58   ` Arnd Bergmann
2010-02-08  2:56   ` Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100205070921.4179.39579.sendpatchset@localhost.localdomain \
    --to=amwang@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox