From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Marc Gonzalez <marc.w.gonzalez@free.fr>
Cc: Stephen Boyd <sboyd@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Russell King <linux@armlinux.org.uk>,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Robin Murphy <robin.murphy@arm.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Arnd Bergmann <arnd@arndb.de>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Rafael Wysocki <rjw@rjwysocki.net>,
Suzuki Poulose <suzuki.poulose@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
linux-clk <linux-clk@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND RFC PATCH v3] clk: Use new helper in managed functions
Date: Thu, 20 Feb 2020 12:27:00 +0100 [thread overview]
Message-ID: <20200220112700.GJ3374196@kroah.com> (raw)
In-Reply-To: <f48d1df3-fc1f-ac5c-b11e-330f18aad539@free.fr>
On Thu, Feb 20, 2020 at 11:04:58AM +0100, Marc Gonzalez wrote:
> Introduce devm_add() to wrap devres_alloc() / devres_add() calls.
>
> Using that helper produces simpler code, and smaller object size.
> E.g. with gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu:
>
> text data bss dec hex filename
> - 1708 80 0 1788 6fc drivers/clk/clk-devres.o
> + 1524 80 0 1604 644 drivers/clk/clk-devres.o
>
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
> ---
> Differences from v2 to v3
> x Make devm_add() return an error-code rather than the raw data pointer
> (in case devres_alloc ever returns an ERR_PTR) as suggested by Geert
> x Provide a variadic version devm_vadd() to work with structs as suggested
> by Geert
> x Don't use nested ifs in clk_devm* implementations (hopefully simpler
> code logic to follow) as suggested by Geert
>
> Questions:
> x This patch might need to be split in two? (Introduce the new API, then use it)
> x Convert other subsystems to show the value of this proposal?
> x Maybe comment the API usage somewhere
> ---
> drivers/base/devres.c | 15 ++++++
> drivers/clk/clk-devres.c | 99 ++++++++++++++--------------------------
> include/linux/device.h | 3 ++
> 3 files changed, 53 insertions(+), 64 deletions(-)
>
> diff --git a/drivers/base/devres.c b/drivers/base/devres.c
> index 0bbb328bd17f..b2603789755b 100644
> --- a/drivers/base/devres.c
> +++ b/drivers/base/devres.c
> @@ -685,6 +685,21 @@ int devres_release_group(struct device *dev, void *id)
> }
> EXPORT_SYMBOL_GPL(devres_release_group);
>
> +int devm_add(struct device *dev, dr_release_t func, void *arg, size_t size)
Please add a bunch of kerneldoc here, as I have no idea what this
function does just by looking at the name of it :(
thanks,
greg k-h
WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Marc Gonzalez <marc.w.gonzalez@free.fr>
Cc: Mark Rutland <mark.rutland@arm.com>,
linux-clk <linux-clk@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Stephen Boyd <sboyd@kernel.org>,
Suzuki Poulose <suzuki.poulose@arm.com>,
Michael Turquette <mturquette@baylibre.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Rafael Wysocki <rjw@rjwysocki.net>,
Russell King <linux@armlinux.org.uk>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Robin Murphy <robin.murphy@arm.com>,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: [RESEND RFC PATCH v3] clk: Use new helper in managed functions
Date: Thu, 20 Feb 2020 12:27:00 +0100 [thread overview]
Message-ID: <20200220112700.GJ3374196@kroah.com> (raw)
In-Reply-To: <f48d1df3-fc1f-ac5c-b11e-330f18aad539@free.fr>
On Thu, Feb 20, 2020 at 11:04:58AM +0100, Marc Gonzalez wrote:
> Introduce devm_add() to wrap devres_alloc() / devres_add() calls.
>
> Using that helper produces simpler code, and smaller object size.
> E.g. with gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu:
>
> text data bss dec hex filename
> - 1708 80 0 1788 6fc drivers/clk/clk-devres.o
> + 1524 80 0 1604 644 drivers/clk/clk-devres.o
>
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
> ---
> Differences from v2 to v3
> x Make devm_add() return an error-code rather than the raw data pointer
> (in case devres_alloc ever returns an ERR_PTR) as suggested by Geert
> x Provide a variadic version devm_vadd() to work with structs as suggested
> by Geert
> x Don't use nested ifs in clk_devm* implementations (hopefully simpler
> code logic to follow) as suggested by Geert
>
> Questions:
> x This patch might need to be split in two? (Introduce the new API, then use it)
> x Convert other subsystems to show the value of this proposal?
> x Maybe comment the API usage somewhere
> ---
> drivers/base/devres.c | 15 ++++++
> drivers/clk/clk-devres.c | 99 ++++++++++++++--------------------------
> include/linux/device.h | 3 ++
> 3 files changed, 53 insertions(+), 64 deletions(-)
>
> diff --git a/drivers/base/devres.c b/drivers/base/devres.c
> index 0bbb328bd17f..b2603789755b 100644
> --- a/drivers/base/devres.c
> +++ b/drivers/base/devres.c
> @@ -685,6 +685,21 @@ int devres_release_group(struct device *dev, void *id)
> }
> EXPORT_SYMBOL_GPL(devres_release_group);
>
> +int devm_add(struct device *dev, dr_release_t func, void *arg, size_t size)
Please add a bunch of kerneldoc here, as I have no idea what this
function does just by looking at the name of it :(
thanks,
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-02-20 11:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 10:04 [RESEND RFC PATCH v3] clk: Use new helper in managed functions Marc Gonzalez
2020-02-20 10:04 ` Marc Gonzalez
2020-02-20 11:27 ` Greg Kroah-Hartman [this message]
2020-02-20 11:27 ` Greg Kroah-Hartman
2020-02-20 14:05 ` Marc Gonzalez
2020-02-20 14:05 ` Marc Gonzalez
2020-02-20 14:16 ` Greg Kroah-Hartman
2020-02-20 14:16 ` Greg Kroah-Hartman
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=20200220112700.GJ3374196@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=bjorn.andersson@linaro.org \
--cc=dmitry.torokhov@gmail.com \
--cc=geert@linux-m68k.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@roeck-us.net \
--cc=marc.w.gonzalez@free.fr \
--cc=mark.rutland@arm.com \
--cc=mturquette@baylibre.com \
--cc=rjw@rjwysocki.net \
--cc=robin.murphy@arm.com \
--cc=sboyd@kernel.org \
--cc=sudipm.mukherjee@gmail.com \
--cc=suzuki.poulose@arm.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.