From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Sascha Hauer <s.hauer@pengutronix.de>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
barebox@lists.infradead.org
Subject: [PATCH v2 5/7] include: import {lower,upper}_32_bits helpers
Date: Sat, 26 Jul 2014 17:24:43 +0200 [thread overview]
Message-ID: <1406388285-1666-6-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1406388285-1666-1-git-send-email-sebastian.hesselbarth@gmail.com>
This imports {lower,upper}_32_bits defines to allow to get upper
and lower 32b part of a 64b number.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: barebox@lists.infradead.org
---
include/common.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/include/common.h b/include/common.h
index ca817aac4f06..de635718d2fe 100644
--- a/include/common.h
+++ b/include/common.h
@@ -282,6 +282,22 @@ void barebox_set_hostname(const char *);
} \
)
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
+ * the "right shift count >= width of type" warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
+
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)(n))
+
#define abs(x) ({ \
long __x = (x); \
(__x < 0) ? -__x : __x; \
--
2.0.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-07-26 15:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-26 15:24 [PATCH v2 0/7] Minor USB fixes and xHCI driver Sebastian Hesselbarth
2014-07-26 15:24 ` [PATCH v2 1/7] USB: Fix stale usb devices in usb_device_list Sebastian Hesselbarth
2014-07-26 15:24 ` [PATCH v2 2/7] USB: Count detected USB devices independent of dev_index Sebastian Hesselbarth
2014-07-26 15:24 ` [PATCH v2 3/7] USB: improve error paths and tear-down Sebastian Hesselbarth
2014-07-26 15:24 ` [PATCH v2 4/7] USB: EHCI: use min3 from Linux Sebastian Hesselbarth
2014-07-26 15:24 ` Sebastian Hesselbarth [this message]
2014-07-26 15:24 ` [PATCH v2 6/7] USB: host: add xHCI HCD, Hub, and platform driver Sebastian Hesselbarth
2014-07-26 15:24 ` [PATCH v2 7/7] USB: host: add xHCI PCI driver Sebastian Hesselbarth
2014-07-28 5:41 ` [PATCH v2 0/7] Minor USB fixes and xHCI driver Sascha Hauer
2014-07-28 6:09 ` Sebastian Hesselbarth
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=1406388285-1666-6-git-send-email-sebastian.hesselbarth@gmail.com \
--to=sebastian.hesselbarth@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
--cc=thomas.petazzoni@free-electrons.com \
/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