Skip to contentSkip to conversation

mux: correct prototype for mux_control_try_select()

PATCH In review Patrick Wildt 3 participants 3 messages Jul 13, 2021 – Jul 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mux: correct prototype for mux_control_try_select()

The macro should be passed a state, which should be passed to the actual function. Otherwise using that macro would yield a build error.

---
 include/mux.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/mux.h +2 -2
index 23844f480a..9f80991274 100644
@@ -51,7 +51,7 @@ unsigned int mux_control_states(struct mux_control *mux);
  */
 int __must_check mux_control_select(struct mux_control *mux,
 				    unsigned int state);
-#define mux_control_try_select(mux) mux_control_select(mux)
+#define mux_control_try_select(mux, state) mux_control_select(mux, state)
 
 /**
  * mux_control_deselect() - Deselect the previously selected multiplexer state.
@@ -128,7 +128,7 @@ int __must_check mux_control_select(struct mux_control *mux,
 	return -ENOSYS;
 }
 
-#define mux_control_try_select(mux) mux_control_select(mux)
+#define mux_control_try_select(mux, state) mux_control_select(mux, state)
 
 int mux_control_deselect(struct mux_control *mux)
 {
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw

-JJ since the email would bounce.

Quoted 3 lines · Patrick Wildt

The macro should be passed a state, which should be passed to the actual function. Otherwise using that macro would yield a build error.

Nitpick: Lines are too short. The usual convention is 72 chars and you seem to be terminating them at 60.

Other than this,

Quoted 31 lines
---
 include/mux.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/mux.h +2 -2
index 23844f480a..9f80991274 100644
@@ -51,7 +51,7 @@ unsigned int mux_control_states(struct mux_control *mux);
  */
 int __must_check mux_control_select(struct mux_control *mux,
 				    unsigned int state);
-#define mux_control_try_select(mux) mux_control_select(mux)
+#define mux_control_try_select(mux, state) mux_control_select(mux, state)
 
 /**
  * mux_control_deselect() - Deselect the previously selected multiplexer state.
@@ -128,7 +128,7 @@ int __must_check mux_control_select(struct mux_control *mux,
 	return -ENOSYS;
 }
 
-#define mux_control_try_select(mux) mux_control_select(mux)
+#define mux_control_try_select(mux, state) mux_control_select(mux, state)
 
 int mux_control_deselect(struct mux_control *mux)
 {
Signature · 1 line
2.32.0
Signature · 3 lines
Regards,
Pratyush Yadav
Texas Instruments Inc.