mbox series

[0/4] PM / core: Introduce some helper for better Code reuse

Message ID 20190316045928.31934-1-tiny.windzz@gmail.com (mailing list archive)
Headers show
Series PM / core: Introduce some helper for better Code reuse | expand

Message

Yangtao Li March 16, 2019, 4:59 a.m. UTC
This patch set introduces some functions and macros that help reduce
code duplication.

Yangtao Li (4):
  PM / core: Introduce dpm_async_fn() helper
  PM / core: Introduce DEVICE_SUSPEND_FUNC() helper macro
  PM / core: Introduce ASYNC_RESUME_FUNC() helper macro
  PM / core: Introduce ASYNC_SUSPEND_FUNC() helper macro

 drivers/base/power/main.c | 182 ++++++++++++--------------------------
 1 file changed, 59 insertions(+), 123 deletions(-)

Comments

Pavel Machek March 18, 2019, 12:20 p.m. UTC | #1
On Sat 2019-03-16 00:59:24, Yangtao Li wrote:
> This patch set introduces some functions and macros that help reduce
> code duplication.
> 
> Yangtao Li (4):
>   PM / core: Introduce dpm_async_fn() helper
>   PM / core: Introduce DEVICE_SUSPEND_FUNC() helper macro
>   PM / core: Introduce ASYNC_RESUME_FUNC() helper macro
>   PM / core: Introduce ASYNC_SUSPEND_FUNC() helper macro
> 
>  drivers/base/power/main.c | 182 ++++++++++++--------------------------
>  1 file changed, 59 insertions(+), 123 deletions(-)

I'm not a big fan. Yes, you got line count down. But no, I do not
think "beauty" of the macros makes it worth it.
									Pavel