mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: barebox@lists.infradead.org
Subject: [PATCH 5/5] linux/kernel.h: add more *_MAX, *_MIN macros
Date: Wed, 21 Jan 2015 14:09:19 +0900	[thread overview]
Message-ID: <1421816959-19004-6-git-send-email-yamada.m@jp.panasonic.com> (raw)
In-Reply-To: <1421816959-19004-1-git-send-email-yamada.m@jp.panasonic.com>

Imported from Linux 3.19-rc5.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 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

  parent reply	other threads:[~2015-01-21  5:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21  5:09 [PATCH 0/5] rafactor _*MAX, " Masahiro Yamada
2015-01-21  5:09 ` [PATCH 1/5] fs: ubifs: remove redundant macro defines Masahiro Yamada
2015-01-21  5:09 ` [PATCH 2/5] lib: decompress: remove redundant INT_MAX define Masahiro Yamada
2015-01-21  5:09 ` [PATCH 3/5] linux/kernel.h: move *_MAX, *_MIN macros Masahiro Yamada
2015-01-21  5:09 ` [PATCH 4/5] linux/kernel.h: rename USHORT_MAX, SHORT_MAX, SHORT_MIN Masahiro Yamada
2015-01-21  5:09 ` Masahiro Yamada [this message]
2015-01-21  6:30 ` [PATCH 0/5] rafactor _*MAX, *_MIN macros Jean-Christophe PLAGNIOL-VILLARD
2015-01-21 13:59 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421816959-19004-6-git-send-email-yamada.m@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox