diff mbox series

[v1,3/3] spi: gpio: Make num_chipselect 8-bit in the struct spi_gpio_platform_data

Message ID 20240517194246.747427-4-andriy.shevchenko@linux.intel.com (mailing list archive)
State New
Headers show
Series spi: gpio: Convert to be used outside of OF | expand

Commit Message

Andy Shevchenko May 17, 2024, 7:42 p.m. UTC
There is no use for whole 16-bit for the number of chip select pins.
Drop it to 8 bits.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/spi/spi_gpio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown May 17, 2024, 9:55 p.m. UTC | #1
On Fri, May 17, 2024 at 10:42:03PM +0300, Andy Shevchenko wrote:
> There is no use for whole 16-bit for the number of chip select pins.
> Drop it to 8 bits.

because...?  It's the only field in the struct so it's not like it makes
any meaningful different to struct layout.
Andy Shevchenko May 20, 2024, 9:28 a.m. UTC | #2
On Fri, May 17, 2024 at 10:55:55PM +0100, Mark Brown wrote:
> On Fri, May 17, 2024 at 10:42:03PM +0300, Andy Shevchenko wrote:
> > There is no use for whole 16-bit for the number of chip select pins.
> > Drop it to 8 bits.
> 
> because...?

To make the type stricter, but since there is no other benefits and
this one likely won't help to catch the (incorrect) use of big numbers
I think we don't need it.

> It's the only field in the struct so it's not like it makes
> any meaningful different to struct layout.
diff mbox series

Patch

diff --git a/include/linux/spi/spi_gpio.h b/include/linux/spi/spi_gpio.h
index 5f0e1407917a..30f29df811a4 100644
--- a/include/linux/spi/spi_gpio.h
+++ b/include/linux/spi/spi_gpio.h
@@ -19,7 +19,7 @@ 
  * @num_chipselect: how many target devices to allow
  */
 struct spi_gpio_platform_data {
-	u16		num_chipselect;
+	u8	num_chipselect;
 };
 
 #endif /* __LINUX_SPI_GPIO_H */