hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c
....@@ -1,5 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0
2
-/* Copyright(c) 2013 - 2018 Intel Corporation. */
2
+/* Copyright(c) 2013 - 2019 Intel Corporation. */
33
44 #include "fm10k_common.h"
55
....@@ -297,13 +297,14 @@
297297 {
298298 struct fm10k_mbx_fifo *fifo = &mbx->rx;
299299 u16 total_len = 0, msg_len;
300
- u32 *msg;
301300
302301 /* length should include previous amounts pushed */
303302 len += mbx->pushed;
304303
305304 /* offset in message is based off of current message size */
306305 do {
306
+ u32 *msg;
307
+
307308 msg = fifo->buffer + fm10k_fifo_tail_offset(fifo, total_len);
308309 msg_len = FM10K_TLV_DWORD_LEN(*msg);
309310 total_len += msg_len;
....@@ -966,7 +967,7 @@
966967 if (tail != mbx->head)
967968 return FM10K_MBX_ERR_TAIL;
968969
969
- /* fall through */
970
+ fallthrough;
970971 case FM10K_MSG_DATA:
971972 /* validate that head is moving correctly */
972973 if (!head || (head == FM10K_MSG_HDR_MASK(HEAD)))
....@@ -986,7 +987,7 @@
986987 if ((size < FM10K_VFMBX_MSG_MTU) || (size & (size + 1)))
987988 return FM10K_MBX_ERR_SIZE;
988989
989
- /* fall through */
990
+ fallthrough;
990991 case FM10K_MSG_ERROR:
991992 if (!head || (head == FM10K_MSG_HDR_MASK(HEAD)))
992993 return FM10K_MBX_ERR_HEAD;
....@@ -1569,7 +1570,7 @@
15691570 mbx->mbmem_reg = FM10K_MBMEM_VF(id, 0);
15701571 break;
15711572 }
1572
- /* fall through */
1573
+ fallthrough;
15731574 default:
15741575 return FM10K_MBX_ERR_NO_MBX;
15751576 }
....@@ -1920,7 +1921,6 @@
19201921 /* reduce length by 1 to convert to a mask */
19211922 u16 mbmem_len = mbx->mbmem_len - 1;
19221923 u16 tail_len, len = 0;
1923
- u32 *msg;
19241924
19251925 /* push head behind tail */
19261926 if (mbx->tail < head)
....@@ -1930,6 +1930,8 @@
19301930
19311931 /* determine msg aligned offset for end of buffer */
19321932 do {
1933
+ u32 *msg;
1934
+
19331935 msg = fifo->buffer + fm10k_fifo_head_offset(fifo, len);
19341936 tail_len = len;
19351937 len += FM10K_TLV_DWORD_LEN(*msg);
....@@ -2132,7 +2134,8 @@
21322134 * DWORDs, not bytes. Any invalid values will cause the mailbox to return
21332135 * error.
21342136 **/
2135
-s32 fm10k_sm_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx,
2137
+s32 fm10k_sm_mbx_init(struct fm10k_hw __always_unused *hw,
2138
+ struct fm10k_mbx_info *mbx,
21362139 const struct fm10k_msg_data *msg_data)
21372140 {
21382141 mbx->mbx_reg = FM10K_GMBX;