[PATCH] spi: store names in struct spi_device_id as pointers

Sascha Hauer s.hauer at pengutronix.de
Fri Dec 11 04:58:21 EST 2020


Instead of putting an array for the names into struct spi_device_id
use pointers. This saves around 3000 bytes of binary space in a ARM32
barebox build.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 include/linux/mod_devicetable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 1fbb3dc5c1..2c04454260 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -21,7 +21,7 @@ struct pci_device_id {
 #define SPI_NAME_SIZE 32
 
 struct spi_device_id {
-	char name[SPI_NAME_SIZE];
+	const char *name;
 	unsigned long driver_data;
 };
 
-- 
2.20.1




More information about the barebox mailing list