Skip to content

Commit 8c93bea

Browse files
Yuval Mintzdavem330
authored andcommitted
qed: Additional work toward cleaning C=1
This cleans many of the warnings that would arise in qed as a result of compilations with C=1; Most of those are the addition of missing 'static' to functions, although there are several other fixes as well. Signed-off-by: Yuval Mintz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0189efb commit 8c93bea

File tree

8 files changed

+58
-164
lines changed

8 files changed

+58
-164
lines changed

drivers/net/ethernet/qlogic/qed/qed_cxt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,14 @@ static struct qed_tid_seg *qed_cxt_tid_seg_info(struct qed_hwfn *p_hwfn,
344344
return NULL;
345345
}
346346

347-
void qed_cxt_set_srq_count(struct qed_hwfn *p_hwfn, u32 num_srqs)
347+
static void qed_cxt_set_srq_count(struct qed_hwfn *p_hwfn, u32 num_srqs)
348348
{
349349
struct qed_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr;
350350

351351
p_mgr->srq_count = num_srqs;
352352
}
353353

354-
u32 qed_cxt_get_srq_count(struct qed_hwfn *p_hwfn)
354+
static u32 qed_cxt_get_srq_count(struct qed_hwfn *p_hwfn)
355355
{
356356
struct qed_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr;
357357

@@ -1799,8 +1799,8 @@ int qed_cxt_get_cid_info(struct qed_hwfn *p_hwfn, struct qed_cxt_info *p_info)
17991799
return 0;
18001800
}
18011801

1802-
void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
1803-
struct qed_rdma_pf_params *p_params)
1802+
static void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
1803+
struct qed_rdma_pf_params *p_params)
18041804
{
18051805
u32 num_cons, num_tasks, num_qps, num_mrs, num_srqs;
18061806
enum protocol_type proto;

drivers/net/ethernet/qlogic/qed/qed_debug.c

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ struct phy_defs {
405405
/***************************** Constant Arrays *******************************/
406406

407407
/* Debug arrays */
408-
static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { {0} };
408+
static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { {NULL} };
409409

410410
/* Chip constant definitions array */
411411
static struct chip_defs s_chip_defs[MAX_CHIP_IDS] = {
@@ -4028,10 +4028,10 @@ static enum dbg_status qed_mcp_trace_read_meta(struct qed_hwfn *p_hwfn,
40284028
}
40294029

40304030
/* Dump MCP Trace */
4031-
enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
4032-
struct qed_ptt *p_ptt,
4033-
u32 *dump_buf,
4034-
bool dump, u32 *num_dumped_dwords)
4031+
static enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
4032+
struct qed_ptt *p_ptt,
4033+
u32 *dump_buf,
4034+
bool dump, u32 *num_dumped_dwords)
40354035
{
40364036
u32 trace_data_grc_addr, trace_data_size_bytes, trace_data_size_dwords;
40374037
u32 trace_meta_size_dwords, running_bundle_id, offset = 0;
@@ -4130,10 +4130,10 @@ enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
41304130
}
41314131

41324132
/* Dump GRC FIFO */
4133-
enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
4134-
struct qed_ptt *p_ptt,
4135-
u32 *dump_buf,
4136-
bool dump, u32 *num_dumped_dwords)
4133+
static enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
4134+
struct qed_ptt *p_ptt,
4135+
u32 *dump_buf,
4136+
bool dump, u32 *num_dumped_dwords)
41374137
{
41384138
u32 offset = 0, dwords_read, size_param_offset;
41394139
bool fifo_has_data;
@@ -4192,10 +4192,10 @@ enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
41924192
}
41934193

41944194
/* Dump IGU FIFO */
4195-
enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
4196-
struct qed_ptt *p_ptt,
4197-
u32 *dump_buf,
4198-
bool dump, u32 *num_dumped_dwords)
4195+
static enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
4196+
struct qed_ptt *p_ptt,
4197+
u32 *dump_buf,
4198+
bool dump, u32 *num_dumped_dwords)
41994199
{
42004200
u32 offset = 0, dwords_read, size_param_offset;
42014201
bool fifo_has_data;
@@ -4255,10 +4255,11 @@ enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
42554255
}
42564256

42574257
/* Protection Override dump */
4258-
enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn,
4259-
struct qed_ptt *p_ptt,
4260-
u32 *dump_buf,
4261-
bool dump, u32 *num_dumped_dwords)
4258+
static enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn,
4259+
struct qed_ptt *p_ptt,
4260+
u32 *dump_buf,
4261+
bool dump,
4262+
u32 *num_dumped_dwords)
42624263
{
42634264
u32 offset = 0, size_param_offset, override_window_dwords;
42644265

@@ -6339,10 +6340,11 @@ enum dbg_status qed_print_fw_asserts_results(struct qed_hwfn *p_hwfn,
63396340
}
63406341

63416342
/* Wrapper for unifying the idle_chk and mcp_trace api */
6342-
enum dbg_status qed_print_idle_chk_results_wrapper(struct qed_hwfn *p_hwfn,
6343-
u32 *dump_buf,
6344-
u32 num_dumped_dwords,
6345-
char *results_buf)
6343+
static enum dbg_status
6344+
qed_print_idle_chk_results_wrapper(struct qed_hwfn *p_hwfn,
6345+
u32 *dump_buf,
6346+
u32 num_dumped_dwords,
6347+
char *results_buf)
63466348
{
63476349
u32 num_errors, num_warnnings;
63486350

@@ -6413,8 +6415,8 @@ static void qed_dbg_print_feature(u8 *p_text_buf, u32 text_size)
64136415

64146416
#define QED_RESULTS_BUF_MIN_SIZE 16
64156417
/* Generic function for decoding debug feature info */
6416-
enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
6417-
enum qed_dbg_features feature_idx)
6418+
static enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
6419+
enum qed_dbg_features feature_idx)
64186420
{
64196421
struct qed_dbg_feature *feature =
64206422
&p_hwfn->cdev->dbg_params.features[feature_idx];
@@ -6480,8 +6482,9 @@ enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
64806482
}
64816483

64826484
/* Generic function for performing the dump of a debug feature. */
6483-
enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
6484-
enum qed_dbg_features feature_idx)
6485+
static enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn,
6486+
struct qed_ptt *p_ptt,
6487+
enum qed_dbg_features feature_idx)
64856488
{
64866489
struct qed_dbg_feature *feature =
64876490
&p_hwfn->cdev->dbg_params.features[feature_idx];

drivers/net/ethernet/qlogic/qed/qed_dev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,13 @@ int qed_resc_alloc(struct qed_dev *cdev)
497497
if (p_hwfn->hw_info.personality == QED_PCI_ETH_ROCE) {
498498
num_cons = qed_cxt_get_proto_cid_count(p_hwfn,
499499
PROTOCOLID_ROCE,
500-
0) * 2;
500+
NULL) * 2;
501501
n_eqes += num_cons + 2 * MAX_NUM_VFS_BB;
502502
} else if (p_hwfn->hw_info.personality == QED_PCI_ISCSI) {
503503
num_cons =
504504
qed_cxt_get_proto_cid_count(p_hwfn,
505-
PROTOCOLID_ISCSI, 0);
505+
PROTOCOLID_ISCSI,
506+
NULL);
506507
n_eqes += 2 * num_cons;
507508
}
508509

drivers/net/ethernet/qlogic/qed/qed_ll2.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ static void qed_ll2_kill_buffers(struct qed_dev *cdev)
141141
qed_ll2_dealloc_buffer(cdev, buffer);
142142
}
143143

144-
void qed_ll2b_complete_rx_packet(struct qed_hwfn *p_hwfn,
145-
u8 connection_handle,
146-
struct qed_ll2_rx_packet *p_pkt,
147-
struct core_rx_fast_path_cqe *p_cqe,
148-
bool b_last_packet)
144+
static void qed_ll2b_complete_rx_packet(struct qed_hwfn *p_hwfn,
145+
u8 connection_handle,
146+
struct qed_ll2_rx_packet *p_pkt,
147+
struct core_rx_fast_path_cqe *p_cqe,
148+
bool b_last_packet)
149149
{
150150
u16 packet_length = le16_to_cpu(p_cqe->packet_length);
151151
struct qed_ll2_buffer *buffer = p_pkt->cookie;
@@ -516,7 +516,7 @@ static int qed_ll2_rxq_completion(struct qed_hwfn *p_hwfn, void *cookie)
516516
return rc;
517517
}
518518

519-
void qed_ll2_rxq_flush(struct qed_hwfn *p_hwfn, u8 connection_handle)
519+
static void qed_ll2_rxq_flush(struct qed_hwfn *p_hwfn, u8 connection_handle)
520520
{
521521
struct qed_ll2_info *p_ll2_conn = NULL;
522522
struct qed_ll2_rx_packet *p_pkt = NULL;
@@ -1124,9 +1124,6 @@ static void qed_ll2_prepare_tx_packet_set_bd(struct qed_hwfn *p_hwfn,
11241124
DMA_REGPAIR_LE(start_bd->addr, first_frag);
11251125
start_bd->nbytes = cpu_to_le16(first_frag_len);
11261126

1127-
SET_FIELD(start_bd->bd_flags.as_bitfield, CORE_TX_BD_FLAGS_ROCE_FLAV,
1128-
type);
1129-
11301127
DP_VERBOSE(p_hwfn,
11311128
(NETIF_MSG_TX_QUEUED | QED_MSG_LL2),
11321129
"LL2 [q 0x%02x cid 0x%08x type 0x%08x] Tx Producer at [0x%04x] - set with a %04x bytes %02x BDs buffer at %08x:%08x\n",

drivers/net/ethernet/qlogic/qed/qed_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ static int qed_set_led(struct qed_dev *cdev, enum qed_led_mode mode)
14301430
return status;
14311431
}
14321432

1433-
struct qed_selftest_ops qed_selftest_ops_pass = {
1433+
static struct qed_selftest_ops qed_selftest_ops_pass = {
14341434
.selftest_memory = &qed_selftest_memory,
14351435
.selftest_interrupt = &qed_selftest_interrupt,
14361436
.selftest_register = &qed_selftest_register,

drivers/net/ethernet/qlogic/qed/qed_roce.c

Lines changed: 16 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ static int qed_rdma_alloc(struct qed_hwfn *p_hwfn,
157157
p_hwfn->p_rdma_info = p_rdma_info;
158158
p_rdma_info->proto = PROTOCOLID_ROCE;
159159

160-
num_cons = qed_cxt_get_proto_cid_count(p_hwfn, p_rdma_info->proto, 0);
160+
num_cons = qed_cxt_get_proto_cid_count(p_hwfn, p_rdma_info->proto,
161+
NULL);
161162

162163
p_rdma_info->num_qps = num_cons / 2;
163164

@@ -831,7 +832,7 @@ static int qed_rdma_alloc_pd(void *rdma_cxt, u16 *pd)
831832
return rc;
832833
}
833834

834-
void qed_rdma_free_pd(void *rdma_cxt, u16 pd)
835+
static void qed_rdma_free_pd(void *rdma_cxt, u16 pd)
835836
{
836837
struct qed_hwfn *p_hwfn = (struct qed_hwfn *)rdma_cxt;
837838

@@ -868,8 +869,9 @@ qed_rdma_toggle_bit_create_resize_cq(struct qed_hwfn *p_hwfn, u16 icid)
868869
return toggle_bit;
869870
}
870871

871-
int qed_rdma_create_cq(void *rdma_cxt,
872-
struct qed_rdma_create_cq_in_params *params, u16 *icid)
872+
static int qed_rdma_create_cq(void *rdma_cxt,
873+
struct qed_rdma_create_cq_in_params *params,
874+
u16 *icid)
873875
{
874876
struct qed_hwfn *p_hwfn = (struct qed_hwfn *)rdma_cxt;
875877
struct qed_rdma_info *p_info = p_hwfn->p_rdma_info;
@@ -952,98 +954,10 @@ int qed_rdma_create_cq(void *rdma_cxt,
952954
return rc;
953955
}
954956

955-
int qed_rdma_resize_cq(void *rdma_cxt,
956-
struct qed_rdma_resize_cq_in_params *in_params,
957-
struct qed_rdma_resize_cq_out_params *out_params)
958-
{
959-
struct qed_hwfn *p_hwfn = (struct qed_hwfn *)rdma_cxt;
960-
struct rdma_resize_cq_output_params *p_ramrod_res;
961-
struct rdma_resize_cq_ramrod_data *p_ramrod;
962-
enum qed_rdma_toggle_bit toggle_bit;
963-
struct qed_sp_init_data init_data;
964-
struct qed_spq_entry *p_ent;
965-
dma_addr_t ramrod_res_phys;
966-
u8 fw_return_code;
967-
int rc = -ENOMEM;
968-
969-
DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "icid = %08x\n", in_params->icid);
970-
971-
p_ramrod_res =
972-
(struct rdma_resize_cq_output_params *)
973-
dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
974-
sizeof(struct rdma_resize_cq_output_params),
975-
&ramrod_res_phys, GFP_KERNEL);
976-
if (!p_ramrod_res) {
977-
DP_NOTICE(p_hwfn,
978-
"qed resize cq failed: cannot allocate memory (ramrod)\n");
979-
return rc;
980-
}
981-
982-
/* Get SPQ entry */
983-
memset(&init_data, 0, sizeof(init_data));
984-
init_data.cid = in_params->icid;
985-
init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
986-
init_data.comp_mode = QED_SPQ_MODE_EBLOCK;
987-
988-
rc = qed_sp_init_request(p_hwfn, &p_ent,
989-
RDMA_RAMROD_RESIZE_CQ,
990-
p_hwfn->p_rdma_info->proto, &init_data);
991-
if (rc)
992-
goto err;
993-
994-
p_ramrod = &p_ent->ramrod.rdma_resize_cq;
995-
996-
p_ramrod->flags = 0;
997-
998-
/* toggle the bit for every resize or create cq for a given icid */
999-
toggle_bit = qed_rdma_toggle_bit_create_resize_cq(p_hwfn,
1000-
in_params->icid);
1001-
1002-
SET_FIELD(p_ramrod->flags,
1003-
RDMA_RESIZE_CQ_RAMROD_DATA_TOGGLE_BIT, toggle_bit);
1004-
1005-
SET_FIELD(p_ramrod->flags,
1006-
RDMA_RESIZE_CQ_RAMROD_DATA_IS_TWO_LEVEL_PBL,
1007-
in_params->pbl_two_level);
1008-
1009-
p_ramrod->pbl_log_page_size = in_params->pbl_page_size_log - 12;
1010-
p_ramrod->pbl_num_pages = cpu_to_le16(in_params->pbl_num_pages);
1011-
p_ramrod->max_cqes = cpu_to_le32(in_params->cq_size);
1012-
DMA_REGPAIR_LE(p_ramrod->pbl_addr, in_params->pbl_ptr);
1013-
DMA_REGPAIR_LE(p_ramrod->output_params_addr, ramrod_res_phys);
1014-
1015-
rc = qed_spq_post(p_hwfn, p_ent, &fw_return_code);
1016-
if (rc)
1017-
goto err;
1018-
1019-
if (fw_return_code != RDMA_RETURN_OK) {
1020-
DP_NOTICE(p_hwfn, "fw_return_code = %d\n", fw_return_code);
1021-
rc = -EINVAL;
1022-
goto err;
1023-
}
1024-
1025-
out_params->prod = le32_to_cpu(p_ramrod_res->old_cq_prod);
1026-
out_params->cons = le32_to_cpu(p_ramrod_res->old_cq_cons);
1027-
1028-
dma_free_coherent(&p_hwfn->cdev->pdev->dev,
1029-
sizeof(struct rdma_resize_cq_output_params),
1030-
p_ramrod_res, ramrod_res_phys);
1031-
1032-
DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Resized CQ, rc = %d\n", rc);
1033-
1034-
return rc;
1035-
1036-
err: dma_free_coherent(&p_hwfn->cdev->pdev->dev,
1037-
sizeof(struct rdma_resize_cq_output_params),
1038-
p_ramrod_res, ramrod_res_phys);
1039-
DP_NOTICE(p_hwfn, "Resized CQ, Failed - rc = %d\n", rc);
1040-
1041-
return rc;
1042-
}
1043-
1044-
int qed_rdma_destroy_cq(void *rdma_cxt,
1045-
struct qed_rdma_destroy_cq_in_params *in_params,
1046-
struct qed_rdma_destroy_cq_out_params *out_params)
957+
static int
958+
qed_rdma_destroy_cq(void *rdma_cxt,
959+
struct qed_rdma_destroy_cq_in_params *in_params,
960+
struct qed_rdma_destroy_cq_out_params *out_params)
1047961
{
1048962
struct qed_hwfn *p_hwfn = (struct qed_hwfn *)rdma_cxt;
1049963
struct rdma_destroy_cq_output_params *p_ramrod_res;
@@ -1164,7 +1078,7 @@ static enum roce_flavor qed_roce_mode_to_flavor(enum roce_mode roce_mode)
11641078
return flavor;
11651079
}
11661080

1167-
int qed_roce_alloc_cid(struct qed_hwfn *p_hwfn, u16 *cid)
1081+
static int qed_roce_alloc_cid(struct qed_hwfn *p_hwfn, u16 *cid)
11681082
{
11691083
struct qed_rdma_info *p_rdma_info = p_hwfn->p_rdma_info;
11701084
u32 responder_icid;
@@ -1788,9 +1702,9 @@ static int qed_roce_sp_destroy_qp_requester(struct qed_hwfn *p_hwfn,
17881702
return rc;
17891703
}
17901704

1791-
int qed_roce_query_qp(struct qed_hwfn *p_hwfn,
1792-
struct qed_rdma_qp *qp,
1793-
struct qed_rdma_query_qp_out_params *out_params)
1705+
static int qed_roce_query_qp(struct qed_hwfn *p_hwfn,
1706+
struct qed_rdma_qp *qp,
1707+
struct qed_rdma_query_qp_out_params *out_params)
17941708
{
17951709
struct roce_query_qp_resp_output_params *p_resp_ramrod_res;
17961710
struct roce_query_qp_req_output_params *p_req_ramrod_res;
@@ -1931,7 +1845,7 @@ int qed_roce_query_qp(struct qed_hwfn *p_hwfn,
19311845
return rc;
19321846
}
19331847

1934-
int qed_roce_destroy_qp(struct qed_hwfn *p_hwfn, struct qed_rdma_qp *qp)
1848+
static int qed_roce_destroy_qp(struct qed_hwfn *p_hwfn, struct qed_rdma_qp *qp)
19351849
{
19361850
u32 num_invalidated_mw = 0;
19371851
u32 num_bound_mw = 0;
@@ -2033,7 +1947,7 @@ static int qed_rdma_destroy_qp(void *rdma_cxt, struct qed_rdma_qp *qp)
20331947
return rc;
20341948
}
20351949

2036-
struct qed_rdma_qp *
1950+
static struct qed_rdma_qp *
20371951
qed_rdma_create_qp(void *rdma_cxt,
20381952
struct qed_rdma_create_qp_in_params *in_params,
20391953
struct qed_rdma_create_qp_out_params *out_params)

drivers/net/ethernet/qlogic/qed/qed_roce.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,6 @@ struct qed_rdma_info {
9595
enum protocol_type proto;
9696
};
9797

98-
struct qed_rdma_resize_cq_in_params {
99-
u16 icid;
100-
u32 cq_size;
101-
bool pbl_two_level;
102-
u64 pbl_ptr;
103-
u16 pbl_num_pages;
104-
u8 pbl_page_size_log;
105-
};
106-
107-
struct qed_rdma_resize_cq_out_params {
108-
u32 prod;
109-
u32 cons;
110-
};
111-
112-
struct qed_rdma_resize_cnq_in_params {
113-
u32 cnq_id;
114-
u32 pbl_page_size_log;
115-
u64 pbl_ptr;
116-
};
117-
11898
struct qed_rdma_qp {
11999
struct regpair qp_handle;
120100
struct regpair qp_handle_async;

0 commit comments

Comments
 (0)