]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
signalfd-add-ability-to-return-siginfo-in-a-raw-format-v2-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 7 Feb 2013 01:27:55 +0000 (12:27 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:47:21 +0000 (16:47 +1100)
fix __user annotations, tidy comments and code layout

Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrey Vagin <avagin@openvz.org>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/signalfd.c

index 4439a813ad1d3e50b14620a894f6d859fa6d612b..c723b5d56c8fbc74e8c120eebdcbc22260a49e73 100644 (file)
@@ -75,14 +75,14 @@ static unsigned int signalfd_poll(struct file *file, poll_table *wait)
 }
 
 /*
- * Copy a whole siginfo into users spaces.
+ * Copy a whole siginfo into userspace.
  * The main idea of this format is that it should be enough
  * for restoring siginfo back into the kernel.
  */
 static int signalfd_copy_raw_info(struct signalfd_siginfo __user *siginfo,
                                        siginfo_t *kinfo)
 {
-       siginfo_t *uinfo = (siginfo_t *) siginfo;
+       siginfo_t __user *uinfo = (siginfo_t __user *)siginfo;
        int err;
 
        BUILD_BUG_ON(sizeof(siginfo_t) != sizeof(struct signalfd_siginfo));
@@ -91,19 +91,20 @@ static int signalfd_copy_raw_info(struct signalfd_siginfo __user *siginfo,
 
 #ifdef CONFIG_COMPAT
        if (unlikely(is_compat_task())) {
-               compat_siginfo_t *compat_uinfo = (compat_siginfo_t *) siginfo;
+               compat_siginfo_t __user *compat_uinfo;
 
+               compat_uinfo = (compat_siginfo_t __user *)siginfo;
                err |= copy_siginfo_to_user32(compat_uinfo, kinfo);
                err |= put_user(kinfo->si_code, &compat_uinfo->si_code);
 
-               return err ? -EFAULT: sizeof(*compat_uinfo);
+               return err ? -EFAULT : sizeof(*compat_uinfo);
        }
 #endif
 
        err |= copy_siginfo_to_user(uinfo, kinfo);
        err |= put_user(kinfo->si_code, &uinfo->si_code);
 
-       return err ? -EFAULT: sizeof(*uinfo);
+       return err ? -EFAULT : sizeof(*uinfo);
 }
 
 /*