[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHQ1cqEVY1_1L8ijbhcTvjGPuFCkytpN25qoUEUcgWFK88y9Fw@mail.gmail.com>
Date: Wed, 18 Oct 2017 08:50:24 -0700
From: Andrey Smirnov <andrew.smirnov@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-watchdog@...r.kernel.org, Chris Healy <cphealy@...il.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Wim Van Sebroeck <wim@...ana.be>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Guenter Roeck <linux@...ck-us.net>
Subject: Re: [PATCH v2] watchdog: core: Make use of devm_register_reboot_notifier()
On Tue, Oct 17, 2017 at 3:08 PM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
> On Tue, 17 Oct 2017 08:50:12 -0700 Andrey Smirnov <andrew.smirnov@...il.com> wrote:
>
>> On Sat, Apr 15, 2017 at 11:11 PM, Guenter Roeck <linux@...ck-us.net> wrote:
>> > On 04/11/2017 09:06 AM, Andrey Smirnov wrote:
>> >>
>> >> Save a bit of cleanup code by leveraging newly added
>> >> devm_register_reboot_notifier().
>> >>
>> >> Cc: cphealy@...il.com
>> >> Cc: linux-kernel@...r.kernel.org
>> >> Cc: Wim Van Sebroeck <wim@...ana.be>
>> >> Cc: Guenter Roeck <linux@...ck-us.net>
>> >> Cc: Andy Shevchenko <andy.shevchenko@...il.com>
>> >> Cc: Andrew Morton <akpm@...ux-foundation.org>
>> >> Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
>> >
>> >
>> > Acked-by: Guenter Roeck <linux@...ck-us.net>
>> >
>>
>> Andrew,
>>
>> This patch can't go in via watchdog tree because it depends on
>> devm_register_reboot_notifier() which is still present only in
>> linux-next, any change you can pull this into linux-next as well?
>
> That's because I've been sitting on
> kernel-reboot-add-devm_register_reboot_notifier.patch since March
> because it has no users.
>
Ah! I suspected that was the case.
> This patch adds a user. Have you identified other sites which
> can/should use devm_register_reboot_notifier()? I guess quite a lot,
> so it's a matter of alerting developers to the new interface. I
> wonder how. A checkpatch rule would do it, but that's new ground for
> checkpatch.
>
I can't say I looked for it in every nook and cranny, but I did look
at ~80% of the results that grepping for "register_reboot_notifier("
produces and it looked like lion's share of the code calling the
function didn't have a device to tie the registration lifespan to. For
dozen or so cases where there was a device to use, majority had the
call being done in the middle of probe/removal sequence, so it was
hard to tell if using devm_ version would be possible and if it would
give any significant benefits code reduction wise. However, there were
three places that looked like they had a pretty clear case for
conversion:
- drivers/input/misc/pm8941-pwrkey.c looked like a poster child for
the conversion, since the only thing it does in .remov is call
unregister_reboot_notifier()
- drivers/soc/lantiq/gphy.c and drivers/rtc/rtc-m41t80.c both looked
like they can be converted as well
Hope this is helpful.
Please, let me know if there's more action I should take about it.
Thanks,
Andrey Smirnov
Powered by blists - more mailing lists