lkml.org 
[lkml]   [2019]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long
Date
Currently, it's an int.  This is bizarre.  Fortunately, the code
using it still works: ~__X32_SYSCALL_BIT is also int, so, if nr is
unsigned long, then C kindly sign-extends the ~__X32_SYSCALL_BIT
part, and we actually get the desired value.

This is far more subtle than it deserves to be. Syscall numbers
are, for all practical purposes, unsigned long, so make
__X32_SYSCALL_BIT be unsigned long.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
arch/x86/include/uapi/asm/unistd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/uapi/asm/unistd.h b/arch/x86/include/uapi/asm/unistd.h
index 30d7d04d72d6..196fdd02b8b1 100644
--- a/arch/x86/include/uapi/asm/unistd.h
+++ b/arch/x86/include/uapi/asm/unistd.h
@@ -3,7 +3,7 @@
#define _UAPI_ASM_X86_UNISTD_H

/* x32 syscall flag bit */
-#define __X32_SYSCALL_BIT 0x40000000
+#define __X32_SYSCALL_BIT 0x40000000UL

#ifndef __KERNEL__
# ifdef __i386__
--
2.21.0
\
 
 \ /
  Last update: 2019-07-03 22:35    [W:0.078 / U:2.708 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site