Re: [PATCH] usb-storage: Use const to reduce object data size

From: Alan Stern
Date: Fri Feb 14 2020 - 17:02:04 EST


On Fri, 14 Feb 2020, Joe Perches wrote:

> Make structs const to reduce data size ~20KB.
>
> Change function arguments and prototypes as necessary to compile.
>
> $ size (x86-64 defconfig pre)
> text data bss dec hex filename
> 12281 10948 480 23709 5c9d ./drivers/usb/storage/usb.o
> 111 10528 8 10647 2997 ./drivers/usb/storage/usual-tables.o
>
> $ size (x86-64 defconfig post)
> text data bss dec hex filename
> 22809 420 480 23709 5c9d drivers/usb/storage/usb.o
> 10551 0 0 10551 2937 drivers/usb/storage/usual-tables.o
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
> ---
>
> compile tested only
>
> drivers/usb/storage/usb.c | 10 +++++-----
> drivers/usb/storage/usb.h | 5 +++--
> drivers/usb/storage/usual-tables.c | 6 +++---
> include/linux/usb_usual.h | 2 +-
> 4 files changed, 12 insertions(+), 11 deletions(-)

It all looks quite reasonable.

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

Alan Stern