mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH v1 1/2] regmap: redefined regmap_read_poll_timeout to simplify code
@ 2020-04-19 17:09 Markus Elfring
  2020-04-20 13:30 ` Dejin Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2020-04-19 17:09 UTC (permalink / raw)
  To: Dejin Zheng, Mark Brown; +Cc: linux-kernel, kernel-janitors

> use read_poll_timeout macro to redefined regmap_read_poll_timeout
> and 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”.


…
> +++ b/include/linux/regmap.h
…
> @@ -122,26 +123,10 @@ struct reg_sequence {
>   */
>  #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \
>  ({ \
…
> +	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

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH v1 0/2] use read_poll_timeout macro to simplify code
@ 2020-04-19 13:51 Dejin Zheng
  2020-04-19 13:51 ` [PATCH v1 1/2] regmap: redefined regmap_read_poll_timeout " Dejin Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Dejin Zheng @ 2020-04-19 13:51 UTC (permalink / raw)
  To: broonie, linux-kernel; +Cc: Dejin Zheng

redefined regmap_read_poll_timeout and regmap_field_read_poll_timeout
by read_poll_timeout to simplify code, they have many similar codes.

Dejin Zheng (2):
  regmap: redefined regmap_read_poll_timeout to simplify code
  regmap: redefined regmap_field_read_poll_timeout to simplify code

 include/linux/regmap.h | 48 ++++++++----------------------------------
 1 file changed, 9 insertions(+), 39 deletions(-)

-- 
2.25.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-20 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-19 17:09 [PATCH v1 1/2] regmap: redefined regmap_read_poll_timeout to simplify code Markus Elfring
2020-04-20 13:30 ` Dejin Zheng
  -- strict thread matches above, loose matches on Subject: below --
2020-04-19 13:51 [PATCH v1 0/2] use read_poll_timeout macro " Dejin Zheng
2020-04-19 13:51 ` [PATCH v1 1/2] regmap: redefined regmap_read_poll_timeout " Dejin Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®