diff mbox series

[RFC,1/2] batctl: Combine command section attributes

Message ID 20210605124511.92537-1-sven@narfation.org
State Accepted, archived
Delegated to: Simon Wunderlich
Headers show
Series [RFC,1/2] batctl: Combine command section attributes | expand

Commit Message

Sven Eckelmann June 5, 2021, 12:45 p.m. UTC
The __used__ and __section__ attribute for the batctl commands can be
combined together to simplify the COMMAND_NAMED macro.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/main.h b/main.h
index d1bea23..00b2ab3 100644
--- a/main.h
+++ b/main.h
@@ -112,7 +112,7 @@  struct command {
 		.usage = (_usage), \
 	}; \
 	static const struct command *__command_ ## _name ## _ ## _type \
-	__attribute__((__used__)) __attribute__ ((__section__ ("__command"))) = &command_ ## _name ## _ ## _type
+	__attribute__((__used__,__section__ ("__command"))) = &command_ ## _name ## _ ## _type
 
 #define COMMAND(_type, _handler, _abbr, _flags, _arg, _usage) \
 	COMMAND_NAMED(_type, _handler, _abbr, _handler, _flags, _arg, _usage)