From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: hagen@jauu.net, benh@kernel.crashing.org,
herbert@gondor.hengli.com.au, hsweeten@visionengravers.com,
joe@perches.com, linux@arm.linux.org.uk, mingo@elte.hu,
penberg@cs.helsinki.fi, rolandd@cisco.com, sean.hefty@intel.com,
tglx@linutronix.de
Subject: + kernelh-add-minmax3-macros.patch added to -mm tree
Date: Thu, 19 Aug 2010 16:14:31 -0700 [thread overview]
Message-ID: <201008192314.o7JNEVvk014123@imap1.linux-foundation.org> (raw)
The patch titled
kernel.h: add {min,max}3 macros
has been added to the -mm tree. Its filename is
kernelh-add-minmax3-macros.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: kernel.h: add {min,max}3 macros
From: Hagen Paul Pfeifer <hagen@jauu.net>
Introduce two additional min/max macros to compare three operands. This
will save some cycles as well as some bytes on the stack and last but not
least more pleasing as macro nesting.
Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Joe Perches <joe@perches.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/kernel.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff -puN include/linux/kernel.h~kernelh-add-minmax3-macros include/linux/kernel.h
--- a/include/linux/kernel.h~kernelh-add-minmax3-macros
+++ a/include/linux/kernel.h
@@ -640,6 +640,22 @@ static inline void ftrace_dump(enum ftra
(void) (&_max1 == &_max2); \
_max1 > _max2 ? _max1 : _max2; })
+#define min3(x, y, z) ({ \
+ typeof(x) _min1 = (x); \
+ typeof(y) _min2 = (y); \
+ typeof(z) _min3 = (z); \
+ (void) (&_min1 == &_min2 == &_min3); \
+ _min1 < _min2 ? (_min1 < _min3 ? _min1 : _min3) : \
+ (_min2 < _min3 ? _min2 : _min3); })
+
+#define max3(x, y, z) ({ \
+ typeof(x) _max1 = (x); \
+ typeof(y) _max2 = (y); \
+ typeof(z) _max3 = (z); \
+ (void) (&_max1 == &_max2 == &_max3); \
+ _max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \
+ (_max2 > _max3 ? _max2 : _max3); })
+
/**
* clamp - return a value clamped to a given range with strict typechecking
* @val: current value
_
Patches currently in -mm which might be from hagen@jauu.net are
kernelh-add-minmax3-macros.patch
replace-nested-max-min-macros-with-maxmin3-macro.patch
reply other threads:[~2010-08-19 23:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=201008192314.o7JNEVvk014123@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=hagen@jauu.net \
--cc=herbert@gondor.hengli.com.au \
--cc=hsweeten@visionengravers.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@elte.hu \
--cc=mm-commits@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
--cc=rolandd@cisco.com \
--cc=sean.hefty@intel.com \
--cc=tglx@linutronix.de \
/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