scsi: fnic: make array dev_cmd_err static const, makes object smaller
Subsystems (3)
PATCH 1/1 scsi: fnic: make array dev_cmd_err static const, makes object smaller
From: Colin Ian King <[email protected]>
Don't populate the array dev_cmd_err on the stack but instead make it static const. Makes the object code smaller by 80 bytes.
Before:
text data bss dec hex filename
21461 1564 0 23025 59f1 drivers/scsi/fnic/vnic_dev.o
After:
text data bss dec hex filename
21318 1628 0 22946 59a2 drivers/scsi/fnic/vnic_dev.o
(gcc version 9.2.1, amd64)
Signed-off-by Colin Ian King <[email protected]>
--- drivers/scsi/fnic/vnic_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/fnic/vnic_dev.c +1 -1
@@ -259,7 +259,7 @@ int vnic_dev_cmd1(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, int wait)struct vnic_devcmd __iomem *devcmd = vdev->devcmd;int delay;u32 status; -int dev_cmd_err[] = { +static const int dev_cmd_err[] = {/* convert from fw's version of error.h to host's version */ 0 ,/* ERR_SUCCESS */ EINVAL ,/* ERR_EINVAL */
Signature · 1 line
2.20.1
Martin K. Petersen
AppliedColin,
Quoted 2 lines
Don't populate the array
dev_cmd_erron the stack but instead make it static const. Makes the object code smaller by 80 bytes.
Applied to 5.5/scsi-queue, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering