Re: [PATCH] scsi: fnic: make array dev_cmd_err static const, makes object smaller

2019-09-30 Thread Martin K. Petersen


Colin,

> 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.

Applied to 5.5/scsi-queue, thanks!

-- 
Martin K. Petersen  Oracle Linux Engineering


[PATCH] scsi: fnic: make array dev_cmd_err static const, makes object smaller

2019-09-06 Thread Colin King
From: Colin Ian King 

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:
   textdata bss dec hex filename
  214611564   0   2302559f1 drivers/scsi/fnic/vnic_dev.o

After:
   textdata bss dec hex filename
  213181628   0   2294659a2 drivers/scsi/fnic/vnic_dev.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King 
---
 drivers/scsi/fnic/vnic_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c
index 78af9cc2009b..f7f445c6b4fc 100644
--- a/drivers/scsi/fnic/vnic_dev.c
+++ b/drivers/scsi/fnic/vnic_dev.c
@@ -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 */
-- 
2.20.1