lkml.org 
[lkml]   [2020]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [v2] iio: core: move 'indio_dev->info' null check first
Date
On Tue, 2020-04-07 at 11:01 +0000, Ardelean, Alexandru wrote:
> [External]
>
> On Tue, 2020-04-07 at 12:42 +0200, Markus Elfring wrote:
> > [External]
> >
> > > So, over time I got the habit of mentioning 'Doesn't fix anything.'
> >
> > I suggest to reconsider such information once more.
> > We come along different interpretations for remarkable software adjustments.
> >
> >
> > > if the patch doesn't fix anything.
> >
> > Do you improve the input parameter validation a bit in principle here?
>
> I thought that was obvious from the rest of the description + patch.
> I guess it isn't.
>
> I'll see.

So, how about this:
---------------------------------------------
Doesn't fix anything. Just moves this to be the first check, as it's very
simple and fails the registration earlier, instead of potentially
initializing the 'indio_dev->label' and checking for duplicate indexes, and
then failing with this simple-check.

This is a minor optimization, since '__iio_device_register()' will waste
fewer validation cycles in case 'indio_dev->info' is NULL.
---------------------------------------------
?


>
> > Regards,
> > Markus
\
 
 \ /
  Last update: 2020-04-07 13:30    [W:0.040 / U:7.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site