lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8866e533-967f-e208-1ec8-888d72f3052e@free.fr>
Date:   Thu, 20 Feb 2020 15:05:54 +0100
From:   Marc Gonzalez <marc.w.gonzalez@...e.fr>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Stephen Boyd <sboyd@...nel.org>,
        Michael Turquette <mturquette@...libre.com>,
        Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
        Russell King <linux@...linux.org.uk>,
        Sudip Mukherjee <sudipm.mukherjee@...il.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Guenter Roeck <linux@...ck-us.net>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Robin Murphy <robin.murphy@....com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Arnd Bergmann <arnd@...db.de>,
        Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        Rafael Wysocki <rjw@...ysocki.net>,
        Suzuki Poulose <suzuki.poulose@....com>,
        Mark Rutland <mark.rutland@....com>,
        linux-clk <linux-clk@...r.kernel.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND RFC PATCH v3] clk: Use new helper in managed functions

On 20/02/2020 12:27, Greg Kroah-Hartman wrote:

> 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@...e.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 :(

Fair enough. (This was one of my "Questions" in the patch comments.)

Note: My patch adds a new function, then makes use of said function.
Is this typically done in two patches or one?

Patch 1/2 augmenting the API.
Patch 2/2 making use of the new function.

Regards.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ