Skip to content

Commit 8ee065a

Browse files
andy-shevakpm00
authored andcommitted
resource: split DEFINE_RES_NAMED_DESC() out of DEFINE_RES_NAMED()
Patch series "resource: Split and use DEFINE_RES*() macros", v2. Replace open coded variants of DEFINE_RES*() macros. Note, there are many more possibilities over the kernel and even in reources.c, however the latter contains not so trivial leftovers. That's why the examples cover only straightforward conversions. This patch (of 4): In some cases it would be useful to supply predefined descriptor of the resource. For this, introduce DEFINE_RES_NAMED_DESC() macro. While at it, provide DEFINE_RES() that takes only start, size, and flags. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Cc: Ilpo Järvinen <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2158599 commit 8ee065a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

include/linux/ioport.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,20 @@ enum {
154154
};
155155

156156
/* helpers to define resources */
157-
#define DEFINE_RES_NAMED(_start, _size, _name, _flags) \
157+
#define DEFINE_RES_NAMED_DESC(_start, _size, _name, _flags, _desc) \
158158
(struct resource) { \
159159
.start = (_start), \
160160
.end = (_start) + (_size) - 1, \
161161
.name = (_name), \
162162
.flags = (_flags), \
163-
.desc = IORES_DESC_NONE, \
163+
.desc = (_desc), \
164164
}
165165

166+
#define DEFINE_RES_NAMED(_start, _size, _name, _flags) \
167+
DEFINE_RES_NAMED_DESC(_start, _size, _name, _flags, IORES_DESC_NONE)
168+
#define DEFINE_RES(_start, _size, _flags) \
169+
DEFINE_RES_NAMED(_start, _size, NULL, _flags)
170+
166171
#define DEFINE_RES_IO_NAMED(_start, _size, _name) \
167172
DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
168173
#define DEFINE_RES_IO(_start, _size) \

0 commit comments

Comments
 (0)