linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/4] spidev: Do not use atomic bit operations when allocating minor
@ 2022-03-23 14:02 Andy Shevchenko
  2022-03-23 14:02 ` [PATCH v1 2/4] spidev: Convert BUILD_BUG_ON() to static_assert() Andy Shevchenko
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-03-23 14:02 UTC (permalink / raw)
  To: Andy Shevchenko, linux-spi, linux-kernel; +Cc: Mark Brown

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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spidev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 53a551714265..daeaa4a30290 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -795,7 +795,7 @@ static int spidev_probe(struct spi_device *spi)
 		status = -ENODEV;
 	}
 	if (status == 0) {
-		set_bit(minor, minors);
+		__set_bit(minor, minors);
 		list_add(&spidev->device_entry, &device_list);
 	}
 	mutex_unlock(&device_list_lock);
@@ -823,7 +823,7 @@ static void spidev_remove(struct spi_device *spi)
 
 	list_del(&spidev->device_entry);
 	device_destroy(spidev_class, spidev->devt);
-	clear_bit(MINOR(spidev->devt), minors);
+	__clear_bit(MINOR(spidev->devt), minors);
 	if (spidev->users == 0)
 		kfree(spidev);
 	mutex_unlock(&device_list_lock);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-04-05 11:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-23 14:02 [PATCH v1 1/4] spidev: Do not use atomic bit operations when allocating minor Andy Shevchenko
2022-03-23 14:02 ` [PATCH v1 2/4] spidev: Convert BUILD_BUG_ON() to static_assert() Andy Shevchenko
2022-03-23 14:02 ` [PATCH v1 3/4] spidev: Replace ACPI specific code by device_get_match_data() Andy Shevchenko
2022-03-23 14:02 ` [PATCH v1 4/4] spidev: Replace OF specific code by device property API Andy Shevchenko
2022-03-23 16:39 ` [PATCH v1 1/4] spidev: Do not use atomic bit operations when allocating minor Mark Brown
2022-03-23 17:22   ` Andy Shevchenko
2022-03-23 19:06     ` Mark Brown
2022-03-24  9:24       ` Andy Shevchenko
2022-03-24 14:28         ` Mark Brown
2022-03-25 11:09           ` Andy Shevchenko
2022-03-26  1:29             ` Yury Norov
2022-03-25 12:44 ` Andy Shevchenko
2022-03-25 13:26   ` Mark Brown
2022-03-25 13:44     ` Andy Shevchenko
2022-04-05  9:32 ` (subset) " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).