Skip to content

Commit 1dc05a2

Browse files
andy-shevgregkh
authored andcommitted
device property: Replace custom implementation of COUNT_ARGS()
Replace custom and non-portable implementation of COUNT_ARGS(). Fixes: e64b674 ("software node: implement reference properties") Reported-by: Nick Desaulniers <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Takashi Iwai <[email protected]> Closes: ClangBuiltLinux#1935 Reviewed-by: Nick Desaulniers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 98ad1dd commit 1dc05a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/linux/property.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#ifndef _LINUX_PROPERTY_H_
1111
#define _LINUX_PROPERTY_H_
1212

13+
#include <linux/args.h>
1314
#include <linux/bits.h>
1415
#include <linux/fwnode.h>
1516
#include <linux/stddef.h>
@@ -288,7 +289,7 @@ struct software_node_ref_args {
288289
#define SOFTWARE_NODE_REFERENCE(_ref_, ...) \
289290
(const struct software_node_ref_args) { \
290291
.node = _ref_, \
291-
.nargs = ARRAY_SIZE(((u64[]){ 0, ##__VA_ARGS__ })) - 1, \
292+
.nargs = COUNT_ARGS(__VA_ARGS__), \
292293
.args = { __VA_ARGS__ }, \
293294
}
294295

0 commit comments

Comments
 (0)