lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240102140734.v4.1.I59b56ebd2f303784031c27bbb1529cf6ef71ba16@changeid>
Date: Tue,  2 Jan 2024 14:07:25 -0700
From: Mark Hasemeyer <markhas@...omium.org>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Sudeep Holla <sudeep.holla@....com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Rob Herring <robh@...nel.org>,
	Andy Shevchenko <andriy.shevchenko@...el.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
	Konrad Dybcio <konrad.dybcio@...aro.org>,
	Raul Rangel <rrangel@...omium.org>,
	Tzung-Bi Shih <tzungbi@...nel.org>,
	Mark Hasemeyer <markhas@...omium.org>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	AKASHI Takahiro <takahiro.akashi@...aro.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Baoquan He <bhe@...hat.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH v4 01/24] resource: Add DEFINE_RES_*_NAMED_FLAGS macro

In some cases, it would be nice to instantiate a struct resource with
custom flags. For example, creating an IRQ resource with a flag that
marks the interrupt as wake capable.

Add a set of macros to provide custom flag arguments.

Suggested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Mark Hasemeyer <markhas@...omium.org>
---

Changes in v4:
-Update Andy's email to @linux.intel.com
-Add Reviewed-by tag

Changes in v3:
-New patch

 include/linux/ioport.h | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index db7fe25f33700..a44e73ca058a8 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -163,28 +163,38 @@ enum {
 		.desc = IORES_DESC_NONE,				\
 	}
 
+#define DEFINE_RES_IO_NAMED_FLAGS(_start, _size, _name, _flags)		\
+	DEFINE_RES_NAMED((_start), (_size), (_name), (_flags) | IORESOURCE_IO)
 #define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
-	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
+	DEFINE_RES_IO_NAMED_FLAGS((_start), (_size), (_name), 0)
 #define DEFINE_RES_IO(_start, _size)					\
 	DEFINE_RES_IO_NAMED((_start), (_size), NULL)
 
+#define DEFINE_RES_MEM_NAMED_FLAGS(_start, _size, _name, _flags)	\
+	DEFINE_RES_NAMED((_start), (_size), (_name), (_flags) | IORESOURCE_MEM)
 #define DEFINE_RES_MEM_NAMED(_start, _size, _name)			\
-	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM)
+	DEFINE_RES_MEM_NAMED_FLAGS((_start), (_size), (_name), 0)
 #define DEFINE_RES_MEM(_start, _size)					\
 	DEFINE_RES_MEM_NAMED((_start), (_size), NULL)
 
+#define DEFINE_RES_REG_NAMED_FLAGS(_start, _size, _name, _flags)	\
+	DEFINE_RES_NAMED((_start), (_size), (_name), (_flags) | IORESOURCE_REG)
 #define DEFINE_RES_REG_NAMED(_start, _size, _name)			\
-	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_REG)
+	DEFINE_RES_REG_NAMED_FLAGS((_start), (_size), (_name), 0)
 #define DEFINE_RES_REG(_start, _size)					\
 	DEFINE_RES_REG_NAMED((_start), (_size), NULL)
 
+#define DEFINE_RES_IRQ_NAMED_FLAGS(_irq, _name, _flags)			\
+	DEFINE_RES_NAMED((_irq), 1, (_name), (_flags) | IORESOURCE_IRQ)
 #define DEFINE_RES_IRQ_NAMED(_irq, _name)				\
-	DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ)
+	DEFINE_RES_IRQ_NAMED_FLAGS((_irq), (_name), 0)
 #define DEFINE_RES_IRQ(_irq)						\
 	DEFINE_RES_IRQ_NAMED((_irq), NULL)
 
+#define DEFINE_RES_DMA_NAMED_FLAGS(_dma, _name, _flags)			\
+	DEFINE_RES_NAMED((_dma), 1, (_name), (_flags) | IORESOURCE_DMA)
 #define DEFINE_RES_DMA_NAMED(_dma, _name)				\
-	DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA)
+	DEFINE_RES_DMA_NAMED_FLAGS((_dma), (_name), 0)
 #define DEFINE_RES_DMA(_dma)						\
 	DEFINE_RES_DMA_NAMED((_dma), NULL)
 
-- 
2.43.0.472.g3155946c3a-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ