[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <10a2d725-7721-f0af-3e2e-de5816730e5d@wanadoo.fr>
Date: Sun, 30 Apr 2023 18:21:36 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-spi@...r.kernel.org
Subject: Re: [PATCH] spi: Use non-atomic xxx_bit() functions
Le 30/04/2023 à 17:49, Mark Brown a écrit :
> On Sun, Apr 30, 2023 at 11:35:35AM +0200, Christophe JAILLET wrote:
>
>> Accesses to 'minors' are guarded by the 'device_list_lock' mutex. So, it is
>> safe to use the non-atomic version of (set|clear)_bit() in the
>> corresponding sections.
>
> Is it a problem to use the atomic version?
Not at all. It just wastes a few cycles (in a place where it doesn't
matter).
I spotted it while looking for some other patterns, so I sent a patch
for it.
>
>> if (status == 0) {
>> - set_bit(minor, minors);
>> + __set_bit(minor, minors);
>> list_add(&spidev->device_entry, &device_list);
>
> The __ usually means something is the more complicated and less
> preferred API.
Ok, let keep things as-is and simple then.
Performance doesn't matter here, anyway.
CJ
Powered by blists - more mailing lists