Skip to content

Commit

Permalink
fs: compat: Remove warning from COMPATIBLE_IOCTL
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mcharleb authored and Al Viro committed Apr 29, 2017
1 parent 0b33540 commit 9280cdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9280cdd

Please sign in to comment.