[PATCH] spi: Drop redundant 'cs' variable declaration in __spi_add_device()

Prabhakar posted 1 patch 4 days, 14 hours ago
drivers/spi/spi.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] spi: Drop redundant 'cs' variable declaration in __spi_add_device()
Posted by Prabhakar 4 days, 14 hours ago
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Remove the redundant local variable 'cs' definition declared within the
chipselect GPIO configuration block.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/spi/spi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 5f57de24b9f7..96a1df0ba4cd 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -732,8 +732,6 @@ static int __spi_add_device(struct spi_device *spi, struct spi_device *parent)
 	}
 
 	if (ctlr->cs_gpiods) {
-		u8 cs;
-
 		for (idx = 0; idx < spi->num_chipselect; idx++) {
 			cs = spi_get_chipselect(spi, idx);
 			spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[cs]);
-- 
2.54.0
Re: [PATCH] spi: Drop redundant 'cs' variable declaration in __spi_add_device()
Posted by Mark Brown 3 days, 7 hours ago
On Wed, 20 May 2026 10:13:42 +0100, Prabhakar wrote:
> spi: Drop redundant 'cs' variable declaration in __spi_add_device()

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.2

Thanks!

[1/1] spi: Drop redundant 'cs' variable declaration in __spi_add_device()
      https://git.kernel.org/broonie/spi/c/90330ae4e0d8

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