lkml.org 
[lkml]   [2022]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/4] spidev: Do not use atomic bit operations when allocating minor
On Wed, Mar 23, 2022 at 04:39:01PM +0000, Mark Brown wrote:
> On Wed, Mar 23, 2022 at 04:02:12PM +0200, Andy Shevchenko wrote:
> > There is no need to use atomic bit operations when allocating a minor
> > number since it's done under a mutex. Moreover, one of the operations
> > that is in use is non-atomic anyway.

...

> > if (status == 0) {
> > - set_bit(minor, minors);
> > + __set_bit(minor, minors);
> > list_add(&spidev->device_entry, &device_list);
>
> There's no *need* but the __ looks suspicious... what's the upside
> here?

It's exactly what is written in the commit message

__*_bit() are non-atomic
*_bit() are atomic

Since they are wrapped by mutex, the atomic ones are not needed.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-03-23 18:37    [W:1.626 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site