Skip to content

Commit 7f566a9

Browse files
Hernán Gonzalezjgunthorpe
authored andcommitted
IB/qib: Move char *qib_sdma_state_names[] and constify while there.
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 <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 4f1d583 commit 7f566a9

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

drivers/infiniband/hw/qib/qib.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,6 @@ enum qib_sdma_events {
472472
qib_sdma_event_e90_timer_tick,
473473
};
474474

475-
extern char *qib_sdma_state_names[];
476-
477475
struct sdma_set_state_action {
478476
unsigned op_enable:1;
479477
unsigned op_intenable:1;

drivers/infiniband/hw/qib/qib_iba7322.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,16 @@ static u8 ib_rate_to_delay[IB_RATE_120_GBPS + 1] = {
463463
[IB_RATE_40_GBPS] = 1
464464
};
465465

466+
static const char * const qib_sdma_state_names[] = {
467+
[qib_sdma_state_s00_hw_down] = "s00_HwDown",
468+
[qib_sdma_state_s10_hw_start_up_wait] = "s10_HwStartUpWait",
469+
[qib_sdma_state_s20_idle] = "s20_Idle",
470+
[qib_sdma_state_s30_sw_clean_up_wait] = "s30_SwCleanUpWait",
471+
[qib_sdma_state_s40_hw_clean_up_wait] = "s40_HwCleanUpWait",
472+
[qib_sdma_state_s50_hw_halt_wait] = "s50_HwHaltWait",
473+
[qib_sdma_state_s99_running] = "s99_Running",
474+
};
475+
466476
#define IBA7322_LINKSPEED_SHIFT SYM_LSB(IBCStatusA_0, LinkSpeedActive)
467477
#define IBA7322_LINKWIDTH_SHIFT SYM_LSB(IBCStatusA_0, LinkWidthActive)
468478

drivers/infiniband/hw/qib/qib_sdma.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ MODULE_PARM_DESC(sdma_descq_cnt, "Number of SDMA descq entries");
5454
#define SDMA_DESC_COUNT_LSB 16
5555
#define SDMA_DESC_GEN_LSB 30
5656

57-
char *qib_sdma_state_names[] = {
58-
[qib_sdma_state_s00_hw_down] = "s00_HwDown",
59-
[qib_sdma_state_s10_hw_start_up_wait] = "s10_HwStartUpWait",
60-
[qib_sdma_state_s20_idle] = "s20_Idle",
61-
[qib_sdma_state_s30_sw_clean_up_wait] = "s30_SwCleanUpWait",
62-
[qib_sdma_state_s40_hw_clean_up_wait] = "s40_HwCleanUpWait",
63-
[qib_sdma_state_s50_hw_halt_wait] = "s50_HwHaltWait",
64-
[qib_sdma_state_s99_running] = "s99_Running",
65-
};
66-
6757
/* declare all statics here rather than keep sorting */
6858
static int alloc_sdma(struct qib_pportdata *);
6959
static void sdma_complete(struct kref *);

0 commit comments

Comments
 (0)