lkml.org 
[lkml]   [2018]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] PM / wakeirq: Add wakeup name to dedicated wake irqs
On Wed, Feb 14, 2018 at 12:23 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Fri, Feb 9, 2018 at 6:14 PM, Tony Lindgren <tony@atomide.com> wrote:
>> This makes it easy to grep :wakeup /proc/interrupts.
>
> I used to have another patch (not published) to provide this
> information via /sys/kernel/irq.
>
> OK, here we are:
>
>
>> + namelen = strlen(dev_name(dev)) + strlen(postfix) + 1;
>> + wirq->name = kzalloc(namelen, GFP_KERNEL);
>
> kasprintf()

It's a bit hard to comment patches sent as attachments, but I'll try anyway. :-)

IMO it is somewhat excessive to put the entire sprintf() under a raw
spinlock and it's not even necessary.

The value can change any time after you've dropped the lock and in
particular before the function returns, so why bother with locking?
desc will not go away from under you at that point anyway.

\
 
 \ /
  Last update: 2018-02-16 10:15    [W:0.073 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site