All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Dejin Zheng <zhengdejin5@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v1 1/2] regmap: redefined regmap_read_poll_timeout to simplify code
Date: Sun, 19 Apr 2020 17:09:14 +0000	[thread overview]
Message-ID: <3376dcba-4285-c894-915e-2f41cbf23caa@web.de> (raw)

> 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

WARNING: multiple messages have this Message-ID (diff)
From: Markus Elfring <Markus.Elfring@web.de>
To: Dejin Zheng <zhengdejin5@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v1 1/2] regmap: redefined regmap_read_poll_timeout to simplify code
Date: Sun, 19 Apr 2020 19:09:14 +0200	[thread overview]
Message-ID: <3376dcba-4285-c894-915e-2f41cbf23caa@web.de> (raw)

> 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

             reply	other threads:[~2020-04-19 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-19 17:09 Markus Elfring [this message]
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
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3376dcba-4285-c894-915e-2f41cbf23caa@web.de \
    --to=markus.elfring@web.de \
    --cc=broonie@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhengdejin5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.