From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.mei.co.jp ([133.183.100.20]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YDnY0-00052l-24 for barebox@lists.infradead.org; Wed, 21 Jan 2015 05:09:48 +0000 Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile14) with ESMTP id t0L59MEe008855 for ; Wed, 21 Jan 2015 14:09:22 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili15) with ESMTP id t0L59MB13575 for ; Wed, 21 Jan 2015 14:09:22 +0900 From: Masahiro Yamada Date: Wed, 21 Jan 2015 14:09:19 +0900 Message-Id: <1421816959-19004-6-git-send-email-yamada.m@jp.panasonic.com> In-Reply-To: <1421816959-19004-1-git-send-email-yamada.m@jp.panasonic.com> References: <1421816959-19004-1-git-send-email-yamada.m@jp.panasonic.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 5/5] linux/kernel.h: add more *_MAX, *_MIN macros To: barebox@lists.infradead.org Imported from Linux 3.19-rc5. Signed-off-by: Masahiro Yamada --- include/linux/kernel.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4d7e41e..a039590 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -16,6 +16,20 @@ #define LLONG_MAX ((long long)(~0ULL>>1)) #define LLONG_MIN (-LLONG_MAX - 1) #define ULLONG_MAX (~0ULL) +#define SIZE_MAX (~(size_t)0) + +#define U8_MAX ((u8)~0U) +#define S8_MAX ((s8)(U8_MAX>>1)) +#define S8_MIN ((s8)(-S8_MAX - 1)) +#define U16_MAX ((u16)~0U) +#define S16_MAX ((s16)(U16_MAX>>1)) +#define S16_MIN ((s16)(-S16_MAX - 1)) +#define U32_MAX ((u32)~0U) +#define S32_MAX ((s32)(U32_MAX>>1)) +#define S32_MIN ((s32)(-S32_MAX - 1)) +#define U64_MAX ((u64)~0ULL) +#define S64_MAX ((s64)(U64_MAX>>1)) +#define S64_MIN ((s64)(-S64_MAX - 1)) /* * This looks more complex than it should be. But we need to -- 1.9.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox