[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190604131516.13596-6-kishon@ti.com>
Date: Tue, 4 Jun 2019 18:44:51 +0530
From: Kishon Vijay Abraham I <kishon@...com>
To: Tom Joseph <tjoseph@...ence.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Arnd Bergmann <arnd@...db.de>,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Frank Rowand <frowand.list@...il.com>,
Jingoo Han <jingoohan1@...il.com>, <linux-pci@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-omap@...r.kernel.org>, <linux-rockchip@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>,
Kishon Vijay Abraham I <kishon@...com>
Subject: [RFC PATCH 05/30] linux/kernel.h: Add PTR_ALIGN_DOWN macro
Add a macro for aligning down a pointer. This is useful to get an
aligned register address when a device allows only word access and
doesn't allow half word or byte access.
Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
---
include/linux/kernel.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 74b1ee9027f5..f5be987f1f95 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -34,6 +34,7 @@
#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
+#define PTR_ALIGN_DOWN(p, a) ((typeof(p))ALIGN_DOWN((unsigned long)(p), (a)))
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
/* generic data direction definitions */
--
2.17.1
Powered by blists - more mailing lists