fs: compat: Remove warning from COMPATIBLE_IOCTL
authorMark Charlebois <[email protected]>
Fri, 28 Apr 2017 22:15:12 +0000 (15:15 -0700)
committerAl Viro <[email protected]>
Sat, 29 Apr 2017 21:47:19 +0000 (17:47 -0400)
cmd in COMPATIBLE_IOCTL is always a u32, so cast it so there isn't a
warning about an overflow in XFORM.

From: Mark Charlebois <[email protected]>
Signed-off-by: Mark Charlebois <[email protected]>
Signed-off-by: Behan Webster <[email protected]>
Signed-off-by: Matthias Kaehlcke <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Al Viro <[email protected]>
fs/compat_ioctl.c

index 11d087b2b28edd79bf03b367d45bfd49bd210352..6116d5275a3ecc7f95d3e3009cca261f8b7c075d 100644 (file)
@@ -833,7 +833,7 @@ static int compat_ioctl_preallocate(struct file *file,
  */
 #define XFORM(i) (((i) ^ ((i) << 27) ^ ((i) << 17)) & 0xffffffff)
 
-#define COMPATIBLE_IOCTL(cmd) XFORM(cmd),
+#define COMPATIBLE_IOCTL(cmd) XFORM((u32)cmd),
 /* ioctl should not be warned about even if it's not implemented.
    Valid reasons to use this:
    - It is implemented with ->compat_ioctl on some device, but programs