Skip to content

Commit 281d0cc

Browse files
Colin Ian Kingdledford
authored andcommitted
RDMA/hns: make various function static, fixes warnings
The functions hns_roce_table_mhop_get, hns_roce_table_mhop_put, hns_roce_cleanup_mhop_hem_table, hns_roce_v1_post_mbox, hns_roce_cmq_setup_basic_desc, hns_roce_cmq_send, hns_roce_cmq_query_hw_info are all local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'hns_roce_table_mhop_get' was not declared. Should it be static? symbol 'hns_roce_table_mhop_put' was not declared. Should it be static? symbol 'hns_roce_cleanup_mhop_hem_table' was not declared. Should it be static? symbol 'hns_roce_v1_post_mbox' was not declared. Should it be static? symbol 'hns_roce_cmq_setup_basic_desc' was not declared. Should it be static? symbol 'hns_roce_cmq_send' was not declared. Should it be static? symbol 'hns_roce_cmq_query_hw_info' was not declared. Should it be static? Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 4ea597e commit 281d0cc

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

drivers/infiniband/hw/hns/hns_roce_hem.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,9 @@ static int hns_roce_set_hem(struct hns_roce_dev *hr_dev,
363363
return ret;
364364
}
365365

366-
int hns_roce_table_mhop_get(struct hns_roce_dev *hr_dev,
367-
struct hns_roce_hem_table *table,
368-
unsigned long obj)
366+
static int hns_roce_table_mhop_get(struct hns_roce_dev *hr_dev,
367+
struct hns_roce_hem_table *table,
368+
unsigned long obj)
369369
{
370370
struct device *dev = hr_dev->dev;
371371
struct hns_roce_hem_mhop mhop;
@@ -576,10 +576,10 @@ int hns_roce_table_get(struct hns_roce_dev *hr_dev,
576576
return ret;
577577
}
578578

579-
void hns_roce_table_mhop_put(struct hns_roce_dev *hr_dev,
580-
struct hns_roce_hem_table *table,
581-
unsigned long obj,
582-
int check_refcount)
579+
static void hns_roce_table_mhop_put(struct hns_roce_dev *hr_dev,
580+
struct hns_roce_hem_table *table,
581+
unsigned long obj,
582+
int check_refcount)
583583
{
584584
struct device *dev = hr_dev->dev;
585585
struct hns_roce_hem_mhop mhop;
@@ -983,8 +983,8 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev,
983983
return -ENOMEM;
984984
}
985985

986-
void hns_roce_cleanup_mhop_hem_table(struct hns_roce_dev *hr_dev,
987-
struct hns_roce_hem_table *table)
986+
static void hns_roce_cleanup_mhop_hem_table(struct hns_roce_dev *hr_dev,
987+
struct hns_roce_hem_table *table)
988988
{
989989
struct hns_roce_hem_mhop mhop;
990990
u32 buf_chunk_size;

drivers/infiniband/hw/hns/hns_roce_hw_v1.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,9 +1628,9 @@ static int hns_roce_v1_cmd_pending(struct hns_roce_dev *hr_dev)
16281628
return (!!(status & (1 << HCR_GO_BIT)));
16291629
}
16301630

1631-
int hns_roce_v1_post_mbox(struct hns_roce_dev *hr_dev, u64 in_param,
1632-
u64 out_param, u32 in_modifier, u8 op_modifier,
1633-
u16 op, u16 token, int event)
1631+
static int hns_roce_v1_post_mbox(struct hns_roce_dev *hr_dev, u64 in_param,
1632+
u64 out_param, u32 in_modifier, u8 op_modifier,
1633+
u16 op, u16 token, int event)
16341634
{
16351635
u32 *hcr = (u32 *)(hr_dev->reg_base + ROCEE_MB1_REG);
16361636
unsigned long end;

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,9 @@ static void hns_roce_v2_cmq_exit(struct hns_roce_dev *hr_dev)
496496
hns_roce_free_cmq_desc(hr_dev, &priv->cmq.crq);
497497
}
498498

499-
void hns_roce_cmq_setup_basic_desc(struct hns_roce_cmq_desc *desc,
500-
enum hns_roce_opcode_type opcode,
501-
bool is_read)
499+
static void hns_roce_cmq_setup_basic_desc(struct hns_roce_cmq_desc *desc,
500+
enum hns_roce_opcode_type opcode,
501+
bool is_read)
502502
{
503503
memset((void *)desc, 0, sizeof(struct hns_roce_cmq_desc));
504504
desc->opcode = cpu_to_le16(opcode);
@@ -542,8 +542,8 @@ static int hns_roce_cmq_csq_clean(struct hns_roce_dev *hr_dev)
542542
return clean;
543543
}
544544

545-
int hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
546-
struct hns_roce_cmq_desc *desc, int num)
545+
static int hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
546+
struct hns_roce_cmq_desc *desc, int num)
547547
{
548548
struct hns_roce_v2_priv *priv = (struct hns_roce_v2_priv *)hr_dev->priv;
549549
struct hns_roce_v2_cmq_ring *csq = &priv->cmq.csq;
@@ -629,7 +629,7 @@ int hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
629629
return ret;
630630
}
631631

632-
int hns_roce_cmq_query_hw_info(struct hns_roce_dev *hr_dev)
632+
static int hns_roce_cmq_query_hw_info(struct hns_roce_dev *hr_dev)
633633
{
634634
struct hns_roce_query_version *resp;
635635
struct hns_roce_cmq_desc desc;

0 commit comments

Comments
 (0)