Skip to content

Commit 358663e

Browse files
committed
regmap-irq: Consistently use memset32() in regmap_irq_thread()
JIRA: https://issues.redhat.com/browse/RHEL-81536 commit 21e9a1d Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Date: Mon, 30 Sep 2024 01:11:09 +0000 The commit 4d60cac ("regmap-irq: Add no_status support") adds an additional branch into IRQ thread handler in regmap. It wisely chose to use memset32() as it might be optimised on some architectures and hence give a performance benefit. At the same time the old code continue using simple memset(). Update the old code to use memset32(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240925082726.620622-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent cfe54c9 commit 358663e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/base/regmap/regmap-irq.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,11 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
364364
memset32(data->status_buf, GENMASK(31, 0), chip->num_regs);
365365
} else if (chip->num_main_regs) {
366366
unsigned int max_main_bits;
367-
unsigned long size;
368-
369-
size = chip->num_regs * sizeof(unsigned int);
370367

371368
max_main_bits = (chip->num_main_status_bits) ?
372369
chip->num_main_status_bits : chip->num_regs;
373370
/* Clear the status buf as we don't read all status regs */
374-
memset(data->status_buf, 0, size);
371+
memset32(data->status_buf, 0, chip->num_regs);
375372

376373
/* We could support bulk read for main status registers
377374
* but I don't expect to see devices with really many main

0 commit comments

Comments
 (0)