public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] regmap: i3c: Use ARRAY_SIZE()
@ 2025-11-03 18:09 Andy Shevchenko
  2025-11-03 18:59 ` Danilo Krummrich
  2025-11-04 16:40 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-11-03 18:09 UTC (permalink / raw)
  To: Andy Shevchenko, linux-kernel
  Cc: Mark Brown, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich

Use ARRAY_SIZE() instead of hard coded numbers to show the intention
and make code robust against potential changes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/regmap/regmap-i3c.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regmap-i3c.c b/drivers/base/regmap/regmap-i3c.c
index b5300b7c477e..6a0f6c826980 100644
--- a/drivers/base/regmap/regmap-i3c.c
+++ b/drivers/base/regmap/regmap-i3c.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 // Copyright (c) 2018 Synopsys, Inc. and/or its affiliates.
 
+#include <linux/array_size.h>
 #include <linux/regmap.h>
 #include <linux/i3c/device.h>
 #include <linux/i3c/master.h>
@@ -18,7 +19,7 @@ static int regmap_i3c_write(void *context, const void *data, size_t count)
 		},
 	};
 
-	return i3c_device_do_priv_xfers(i3c, xfers, 1);
+	return i3c_device_do_priv_xfers(i3c, xfers, ARRAY_SIZE(xfers));
 }
 
 static int regmap_i3c_read(void *context,
@@ -37,7 +38,7 @@ static int regmap_i3c_read(void *context,
 	xfers[1].len = val_size;
 	xfers[1].data.in = val;
 
-	return i3c_device_do_priv_xfers(i3c, xfers, 2);
+	return i3c_device_do_priv_xfers(i3c, xfers, ARRAY_SIZE(xfers));
 }
 
 static const struct regmap_bus regmap_i3c = {
-- 
2.50.1


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

* Re: [PATCH v1 1/1] regmap: i3c: Use ARRAY_SIZE()
  2025-11-03 18:09 [PATCH v1 1/1] regmap: i3c: Use ARRAY_SIZE() Andy Shevchenko
@ 2025-11-03 18:59 ` Danilo Krummrich
  2025-11-04 16:40 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Danilo Krummrich @ 2025-11-03 18:59 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-kernel, Mark Brown, Greg Kroah-Hartman, Rafael J. Wysocki

On 11/3/25 7:09 PM, Andy Shevchenko wrote:
> Use ARRAY_SIZE() instead of hard coded numbers to show the intention
> and make code robust against potential changes.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Danilo Krummrich <dakr@kernel.org>

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

* Re: [PATCH v1 1/1] regmap: i3c: Use ARRAY_SIZE()
  2025-11-03 18:09 [PATCH v1 1/1] regmap: i3c: Use ARRAY_SIZE() Andy Shevchenko
  2025-11-03 18:59 ` Danilo Krummrich
@ 2025-11-04 16:40 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-11-04 16:40 UTC (permalink / raw)
  To: linux-kernel, Andy Shevchenko
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich

On Mon, 03 Nov 2025 19:09:46 +0100, Andy Shevchenko wrote:
> Use ARRAY_SIZE() instead of hard coded numbers to show the intention
> and make code robust against potential changes.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap: i3c: Use ARRAY_SIZE()
      commit: af9c8092d84244ca54ffb590435735f788e7a170

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2025-11-04 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 18:09 [PATCH v1 1/1] regmap: i3c: Use ARRAY_SIZE() Andy Shevchenko
2025-11-03 18:59 ` Danilo Krummrich
2025-11-04 16:40 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox