compat: backport USHRT_MAX, SHRT_MAX and SHRT_MIN
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 27 May 2010 03:01:52 +0000 (20:01 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 27 May 2010 03:01:52 +0000 (20:01 -0700)
This backports this patch:

Author: Alexey Dobriyan <adobriyan@gmail.com>
Date:   Mon May 24 14:33:03 2010 -0700

    kernel-wide: replace USHORT_MAX, SHORT_MAX and SHORT_MIN with USHRT_MAX, SHRT_MAX and SHRT_MIN

    - C99 knows about USHRT_MAX/SHRT_MAX/SHRT_MIN, not
      USHORT_MAX/SHORT_MAX/SHORT_MIN.

    - Make SHRT_MIN of type s16, not int, for consistency.

    [akpm@linux-foundation.org: fix drivers/dma/timb_dma.c]
    [akpm@linux-foundation.org: fix security/keys/keyring.c]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
include/linux/compat-2.6.35.h

index b850f8a..7091f7c 100644 (file)
@@ -6,6 +6,12 @@
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
 #include <linux/etherdevice.h>
 #include <net/sock.h>
+#include <linux/types.h>
+
+/* added on linux/kernel.h */
+#define USHRT_MAX      ((u16)(~0U))
+#define SHRT_MAX       ((s16)(USHRT_MAX>>1))
+#define SHRT_MIN       ((s16)(-SHRT_MAX - 1))
 
 #define IW_HANDLER(id, func)                   \
        [IW_IOCTL_IDX(id)] = func