Skip to contentSkip to conversation

firmware: arm_scmi: replace resevered identifiers in macros

PATCH In review [email protected] 2 participants 2 messages Dec 22, 2021 System control & power/management interface (SCPI/SCMI) Message Protocol drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: arm_scmi: replace resevered identifiers in macros

From: Tom Rix <[email protected]>

Identifiers starting with __ are resevered. Replace __X with X.

The arguments to these macros are pointers. The macros only reads values. There is no need to make copies of the pointers, use them directly.

Fixes a287126c31ab ("firmware: arm_scmi: Add configurable polling mode for transports")
---
 drivers/firmware/arm_scmi/driver.c | 31 ++++++++----------------------
 1 file changed, 8 insertions(+), 23 deletions(-)
drivers/firmware/arm_scmi/driver.c +8 -23
index b4bbfe89368df..d2fcfa9da931c 100644
@@ -36,29 +36,14 @@
 #define CREATE_TRACE_POINTS
 #include <trace/events/scmi.h>
 
-#define IS_POLLING_REQUIRED(__c, __i)					\
-	((__c)->no_completion_irq || (__i)->desc->force_polling)	\
-
-#define IS_TRANSPORT_POLLING_CAPABLE(__i)				\
-({									\
-	bool __ret;							\
-	typeof(__i) i_ = __i;						\
-									\
-	__ret = ((i_)->desc->ops->poll_done ||				\
-			(i_)->desc->sync_cmds_completed_on_ret);	\
-	__ret;								\
-})
-
-#define IS_POLLING_ENABLED(__c, __i)					\
-({									\
-	bool __ret;							\
-	typeof(__c) c_ = __c;						\
-	typeof(__i) i_ = __i;						\
-									\
-	__ret = (IS_POLLING_REQUIRED(c_, i_) &&				\
-			IS_TRANSPORT_POLLING_CAPABLE(i_));		\
-	__ret;								\
-})
+#define IS_POLLING_REQUIRED(c, i)					\
+	((c)->no_completion_irq || (i)->desc->force_polling)
+
+#define IS_TRANSPORT_POLLING_CAPABLE(i)					\
+	((i)->desc->ops->poll_done || (i)->desc->sync_cmds_completed_on_ret)
+
+#define IS_POLLING_ENABLED(c, i)					\
+	(IS_POLLING_REQUIRED(c, i) && IS_TRANSPORT_POLLING_CAPABLE(i))
 
 enum scmi_error_codes {
 	SCMI_SUCCESS = 0,	/* Success */
Signature · 1 line
2.26.3
#1 lore raw
Quoted 8 lines · On Wed, Dec 22, 2021 at 09:25:19AM -0800, [email protected] wrote:

From: Tom Rix <[email protected]>

Identifiers starting with __ are resevered. Replace __X with X.

The arguments to these macros are pointers. The macros only reads values. There is no need to make copies of the pointers, use them directly.

Agreed and thanks for the patch.

However the original patch was modified and these macros were moved to inline functions[0] after the initial build warnings from the build bot[1]. Sorry my reply to the bot seems to have got lost and didn't make it to the list.

Signature · 5 lines
Regards,
Sudeep

[0] https://git.kernel.org/sudeep.holla/c/a690b7e6e7
[1] https://lore.kernel.org/lkml/[email protected]/