mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Russell King <linux@armlinux.org.uk>,
	Guenter Roeck <linux@roeck-us.net>,
	Robin Murphy <robin.murphy@arm.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 0/2] Small devm helper for devm implementations
Date: Mon, 3 May 2021 14:08:33 +0200	[thread overview]
Message-ID: <ddfff98f-ebd5-fa25-e4d4-6f3a7cafa132@free.fr> (raw)
In-Reply-To: <20200723150030.GA2515799@kroah.com>

On 23/07/2020 17:00, Greg Kroah-Hartman wrote:

> On Tue, Jul 21, 2020 at 09:10:23AM +0200, Marc Gonzalez wrote:
> 
>> On 06/07/2020 21:57, Greg Kroah-Hartman wrote:
>>
>>> Given the lack of testing of the patch, it doesn't seem wise to add
>>> this, right?
>>
>> You're probably not wrong :)
>>
>>> Please get some testing, and some more users, and I'll be glad to
>>> consider it.
>>
>> "Users" == files modified to use the new helper?
> 
> Yes.
> 
>> How many files would you suggest? 3? 5? 10?
> 
> How many do you see that can use it?  I would suggest "all" :)

Hello Greg (and everyone on the CC list),

I'm getting the itch to work on this patch-set again.

To recap: I wrote a tiny devm helper.
It's a trivial wrapper around devres_alloc() + devres_add()
which releases the resource when devres_alloc() fails.
That's all there is to it.

Despite its triviality, the helper allows writing simpler code
in drivers using devm, and generates smaller object code,
so I think it's quite useful.


With all that being said, I'm a bit concerned by Greg's "all" answer.

$ git grep '= devres_alloc' | wc -l
173

$ git grep -c '= devres_alloc' | wc -l
103

There are 173 calls to devres_alloc across 103 files.

It looks (to me) too risky to change everything in a single patch-set.

Perhaps we could define a few frameworks that would get the improvement
as a first step?

$ git grep '= devres_alloc' v5.12 | grep -o 'v5.12:[[:alnum:]]*/[[:alnum:]]*' | uniq -c
      1 v5.12:Documentation/driver
      3 v5.12:drivers/ata
     11 v5.12:drivers/base
      1 v5.12:drivers/bus
      1 v5.12:drivers/char
     13 v5.12:drivers/clk
      1 v5.12:drivers/counter
      4 v5.12:drivers/devfreq
      2 v5.12:drivers/dma
      4 v5.12:drivers/extcon
      2 v5.12:drivers/firmware
      4 v5.12:drivers/fpga
      8 v5.12:drivers/gpio
      1 v5.12:drivers/gpu
      2 v5.12:drivers/hid
      2 v5.12:drivers/hwmon
      3 v5.12:drivers/hwspinlock
      1 v5.12:drivers/i2c
     12 v5.12:drivers/iio
      2 v5.12:drivers/input
      1 v5.12:drivers/interconnect
      5 v5.12:drivers/leds
      1 v5.12:drivers/macintosh
      1 v5.12:drivers/mailbox
      2 v5.12:drivers/media
      2 v5.12:drivers/mfd
      1 v5.12:drivers/mtd
      3 v5.12:drivers/mux
      6 v5.12:drivers/net
      1 v5.12:drivers/ntb
      3 v5.12:drivers/nvmem
      1 v5.12:drivers/of
      4 v5.12:drivers/pci
      5 v5.12:drivers/phy
      3 v5.12:drivers/pinctrl
      2 v5.12:drivers/platform
      4 v5.12:drivers/power
      3 v5.12:drivers/pwm
      6 v5.12:drivers/regulator
      1 v5.12:drivers/remoteproc
      3 v5.12:drivers/reset
      3 v5.12:drivers/spi
      2 v5.12:drivers/staging
      3 v5.12:drivers/thermal
      1 v5.12:drivers/tty
      1 v5.12:drivers/uio
      2 v5.12:drivers/usb
      2 v5.12:drivers/video
      1 v5.12:drivers/watchdog
      1 v5.12:kernel/dma
      1 v5.12:kernel/iomem
      5 v5.12:kernel/irq
      1 v5.12:kernel/reboot
      2 v5.12:kernel/resource
      3 v5.12:lib/devres
      1 v5.12:lib/genalloc
      1 v5.12:mm/dmapool
      2 v5.12:net/devres
      1 v5.12:sound/hda
      6 v5.12:sound/soc
      1 v5.12:tools/testing


Perhaps I could take a look at all the subsystems/frameworks that you maintain, Greg?
What do you think?

Regards.

  reply	other threads:[~2021-05-03 12:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 10:11 Marc Gonzalez
2020-03-10 10:15 ` [PATCH v5 1/2] devres: Provide new helper for devm functions Marc Gonzalez
2020-03-10 10:19 ` [PATCH v5 2/2] clk: Use devm_add in managed functions Marc Gonzalez
2020-06-04 16:13 ` [PATCH v5 0/2] Small devm helper for devm implementations Marc Gonzalez
2020-06-04 17:10   ` Greg Kroah-Hartman
2020-06-18 11:38 ` Marc Gonzalez
2020-07-06 15:56   ` Marc Gonzalez
2020-07-06 19:57     ` Greg Kroah-Hartman
2020-07-21  7:10       ` Marc Gonzalez
2020-07-23 15:00         ` Greg Kroah-Hartman
2021-05-03 12:08           ` Marc Gonzalez [this message]
2021-05-03 14:50             ` 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=ddfff98f-ebd5-fa25-e4d4-6f3a7cafa132@free.fr \
    --to=marc.w.gonzalez@free.fr \
    --cc=arnd@arndb.de \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@roeck-us.net \
    --cc=robin.murphy@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 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®