IB/qib: Move char *qib_sdma_state_names[] and constify while there.
authorHernán Gonzalez <hernan@vanguardiasur.com.ar>
Tue, 27 Feb 2018 22:05:43 +0000 (19:05 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 28 Feb 2018 20:57:40 +0000 (13:57 -0700)
Note: This is compile only tested as I have no access to the hw.
This variable was not used in qib_sdma.c but in qib_iba7322.c. Declaring it
there, as static, saves 56 bytes.

add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-144 (-144)
Function                                     old     new   delta
qib_sdma_state_names                          56       -     -56
qib_sdma_event_names                          88       -     -88
Total: Before=2874565, After=2874421, chg -0.01%

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/qib/qib.h
drivers/infiniband/hw/qib/qib_iba7322.c
drivers/infiniband/hw/qib/qib_sdma.c

index b709ebd1fb2e22ce4efa7aa9db6dfd2591e507ca..46072455130c97ec7d4b89cb134eb8ad1286aaa0 100644 (file)
@@ -472,8 +472,6 @@ enum qib_sdma_events {
        qib_sdma_event_e90_timer_tick,
 };
 
-extern char *qib_sdma_state_names[];
-
 struct sdma_set_state_action {
        unsigned op_enable:1;
        unsigned op_intenable:1;
index 6265dac415fc22152cacb2773f2951bb9da62fd9..8414ae44a5185b852899d186e701ec3b023b90ae 100644 (file)
@@ -463,6 +463,16 @@ static u8 ib_rate_to_delay[IB_RATE_120_GBPS + 1] = {
        [IB_RATE_40_GBPS] = 1
 };
 
+static const char * const qib_sdma_state_names[] = {
+       [qib_sdma_state_s00_hw_down]          = "s00_HwDown",
+       [qib_sdma_state_s10_hw_start_up_wait] = "s10_HwStartUpWait",
+       [qib_sdma_state_s20_idle]             = "s20_Idle",
+       [qib_sdma_state_s30_sw_clean_up_wait] = "s30_SwCleanUpWait",
+       [qib_sdma_state_s40_hw_clean_up_wait] = "s40_HwCleanUpWait",
+       [qib_sdma_state_s50_hw_halt_wait]     = "s50_HwHaltWait",
+       [qib_sdma_state_s99_running]          = "s99_Running",
+};
+
 #define IBA7322_LINKSPEED_SHIFT SYM_LSB(IBCStatusA_0, LinkSpeedActive)
 #define IBA7322_LINKWIDTH_SHIFT SYM_LSB(IBCStatusA_0, LinkWidthActive)
 
index 1f2d7a054d90e86e612abd4f46e77e8a92ec97b8..d0723d4aef5c980e69d2a1218cd7ac0e8062f9b3 100644 (file)
@@ -54,16 +54,6 @@ MODULE_PARM_DESC(sdma_descq_cnt, "Number of SDMA descq entries");
 #define SDMA_DESC_COUNT_LSB     16
 #define SDMA_DESC_GEN_LSB       30
 
-char *qib_sdma_state_names[] = {
-       [qib_sdma_state_s00_hw_down]          = "s00_HwDown",
-       [qib_sdma_state_s10_hw_start_up_wait] = "s10_HwStartUpWait",
-       [qib_sdma_state_s20_idle]             = "s20_Idle",
-       [qib_sdma_state_s30_sw_clean_up_wait] = "s30_SwCleanUpWait",
-       [qib_sdma_state_s40_hw_clean_up_wait] = "s40_HwCleanUpWait",
-       [qib_sdma_state_s50_hw_halt_wait]     = "s50_HwHaltWait",
-       [qib_sdma_state_s99_running]          = "s99_Running",
-};
-
 /* declare all statics here rather than keep sorting */
 static int alloc_sdma(struct qib_pportdata *);
 static void sdma_complete(struct kref *);