Skip to content

Commit 89b203e

Browse files
Colin Ian Kingmartinkpetersen
authored andcommitted
scsi: hisi_sas: make several const arrays static
Don't populate various tables on the stack but make them static const. Makes the object code smaller by over 280 bytes: Before: text data bss dec hex filename 39887 5080 64 45031 afe7 hisi_sas_v2_hw.o After: text data bss dec hex filename 39318 5368 64 44750 aece hisi_sas_v2_hw.o Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent fb2028a commit 89b203e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ static int prep_ssp_v2_hw(struct hisi_hba *hisi_hba,
16931693

16941694
static int parse_trans_tx_err_code_v2_hw(u32 err_msk)
16951695
{
1696-
const u8 trans_tx_err_code_prio[] = {
1696+
static const u8 trans_tx_err_code_prio[] = {
16971697
TRANS_TX_OPEN_FAIL_WITH_IT_NEXUS_LOSS,
16981698
TRANS_TX_ERR_PHY_NOT_ENABLE,
16991699
TRANS_TX_OPEN_CNX_ERR_WRONG_DESTINATION,
@@ -1738,7 +1738,7 @@ static int parse_trans_tx_err_code_v2_hw(u32 err_msk)
17381738

17391739
static int parse_trans_rx_err_code_v2_hw(u32 err_msk)
17401740
{
1741-
const u8 trans_rx_err_code_prio[] = {
1741+
static const u8 trans_rx_err_code_prio[] = {
17421742
TRANS_RX_ERR_WITH_RXFRAME_CRC_ERR,
17431743
TRANS_RX_ERR_WITH_RXFIS_8B10B_DISP_ERR,
17441744
TRANS_RX_ERR_WITH_RXFRAME_HAVE_ERRPRM,
@@ -1784,7 +1784,7 @@ static int parse_trans_rx_err_code_v2_hw(u32 err_msk)
17841784

17851785
static int parse_dma_tx_err_code_v2_hw(u32 err_msk)
17861786
{
1787-
const u8 dma_tx_err_code_prio[] = {
1787+
static const u8 dma_tx_err_code_prio[] = {
17881788
DMA_TX_UNEXP_XFER_ERR,
17891789
DMA_TX_UNEXP_RETRANS_ERR,
17901790
DMA_TX_XFER_LEN_OVERFLOW,
@@ -1810,7 +1810,7 @@ static int parse_dma_tx_err_code_v2_hw(u32 err_msk)
18101810

18111811
static int parse_sipc_rx_err_code_v2_hw(u32 err_msk)
18121812
{
1813-
const u8 sipc_rx_err_code_prio[] = {
1813+
static const u8 sipc_rx_err_code_prio[] = {
18141814
SIPC_RX_FIS_STATUS_ERR_BIT_VLD,
18151815
SIPC_RX_PIO_WRSETUP_STATUS_DRQ_ERR,
18161816
SIPC_RX_FIS_STATUS_BSY_BIT_ERR,
@@ -1836,7 +1836,7 @@ static int parse_sipc_rx_err_code_v2_hw(u32 err_msk)
18361836

18371837
static int parse_dma_rx_err_code_v2_hw(u32 err_msk)
18381838
{
1839-
const u8 dma_rx_err_code_prio[] = {
1839+
static const u8 dma_rx_err_code_prio[] = {
18401840
DMA_RX_UNKNOWN_FRM_ERR,
18411841
DMA_RX_DATA_LEN_OVERFLOW,
18421842
DMA_RX_DATA_LEN_UNDERFLOW,

0 commit comments

Comments
 (0)