lkml.org 
[lkml]   [2021]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 2/2] driver core: add helper for deferred probe reason setting
On Fri, Mar 19, 2021 at 1:46 PM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> On 19.03.21 12:13, Andy Shevchenko wrote:
> > On Fri, Mar 19, 2021 at 1:05 PM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >>
> >> We now have three places within the same file doing the same operation
> >> of freeing this pointer and setting it anew. A helper make this
> >
> > makes
> >
> >> arguably easier to read, so add one.
> >
> > FWIW,
> > Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> Thanks will add for v3.
>
> > Now I'm wondering why deferred_probe_reason is not defined with const.
> >
> > Can you check and maybe squeeze a patch in the middle (before these
> > two of this series) to move to const?
>
> The deferred_probe_reason is only used in this file and it either holds
> NULL or a pointer to a dynamically allocated string. I don't see a reason
> why the member should be const.

But we want to be reliant on the contents of the string, right?
I would put this why it shouldn't be const.

As far as I understand the strictness here is for good.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2021-03-19 13:18    [W:0.052 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site