regmap: redefined regmap_read_poll_timeout to simplify code
Quoted 2 lines
use
read_poll_timeoutmacro to redefinedregmap_read_poll_timeoutand also remove the duplicate code.
How do you think about a wording variant like the following?
Subject:
[PATCH 1/2] regmap: Simplify implementation of the regmap_read_poll_timeout() macro
Change description:
Simplify the implementation of the macro “regmap_read_poll_timeout” by using the macro “read_poll_timeout”.
…
Quoted 1 line
+++
b/include/linux/regmap.h
…
Quoted 4 lines
(quoted diff) +0
-0@@ -122,26 +123,10 @@ struct reg_sequence { */ #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ ({ \
…
Review
Quoted 5 lines
(quoted diff) +4
-0+ int __ret, __tmp; \ + __tmp = read_poll_timeout(regmap_read, __ret, __ret || (cond), \ + sleep_us, timeout_us, false, (map), (addr), &(val)); \ + __ret ?: __tmp; \ })
* Can this macro work also with variable names which do not contain double underscores?
* Can the tag “Fixes” be relevant for such an adjustment?
Regards,
Markus
Quoted 12 lines · Markus Elfring
Quoted 2 lines
use
read_poll_timeoutmacro to redefinedregmap_read_poll_timeoutand also remove the duplicate code.How do you think about a wording variant like the following?
Subject:
[PATCH 1/2] regmap: Simplify implementation of theregmap_read_poll_timeout()macroChange description:
Simplify the implementation of the macro “regmap_read_poll_timeout” by using the macro “read_poll_timeout”.
Good, I will send the patch v2.
Quoted 9 lines
…
Quoted 1 line
+++
b/include/linux/regmap.h…
Quoted 4 lines
(quoted diff) +0
-0@@ -122,26 +123,10 @@ struct reg_sequence { */ #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ ({ \…
Quoted 9 lines
Review
Quoted 5 lines
(quoted diff) +4
-0+ int __ret, __tmp; \ + __tmp = read_poll_timeout(regmap_read, __ret, __ret || (cond), \ + sleep_us, timeout_us, false, (map), (addr), &(val)); \ + __ret ?: __tmp; \ })* Can this macro work also with variable names which do not contain double underscores?
Yes, this is to avoid using the same variable with its caller.
Quoted 2 lines
* Can the tag “Fixes” be relevant for such an adjustment?
I think It is not relevant and we don't need add it.
BR,
Dejin
Quoted 2 lines
Regards,
Markus