| .. | .. |
|---|
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | | -/* Copyright(c) 2013 - 2018 Intel Corporation. */ |
|---|
| 2 | +/* Copyright(c) 2013 - 2019 Intel Corporation. */ |
|---|
| 3 | 3 | |
|---|
| 4 | 4 | #include "fm10k_common.h" |
|---|
| 5 | 5 | |
|---|
| .. | .. |
|---|
| 297 | 297 | { |
|---|
| 298 | 298 | struct fm10k_mbx_fifo *fifo = &mbx->rx; |
|---|
| 299 | 299 | u16 total_len = 0, msg_len; |
|---|
| 300 | | - u32 *msg; |
|---|
| 301 | 300 | |
|---|
| 302 | 301 | /* length should include previous amounts pushed */ |
|---|
| 303 | 302 | len += mbx->pushed; |
|---|
| 304 | 303 | |
|---|
| 305 | 304 | /* offset in message is based off of current message size */ |
|---|
| 306 | 305 | do { |
|---|
| 306 | + u32 *msg; |
|---|
| 307 | + |
|---|
| 307 | 308 | msg = fifo->buffer + fm10k_fifo_tail_offset(fifo, total_len); |
|---|
| 308 | 309 | msg_len = FM10K_TLV_DWORD_LEN(*msg); |
|---|
| 309 | 310 | total_len += msg_len; |
|---|
| .. | .. |
|---|
| 966 | 967 | if (tail != mbx->head) |
|---|
| 967 | 968 | return FM10K_MBX_ERR_TAIL; |
|---|
| 968 | 969 | |
|---|
| 969 | | - /* fall through */ |
|---|
| 970 | + fallthrough; |
|---|
| 970 | 971 | case FM10K_MSG_DATA: |
|---|
| 971 | 972 | /* validate that head is moving correctly */ |
|---|
| 972 | 973 | if (!head || (head == FM10K_MSG_HDR_MASK(HEAD))) |
|---|
| .. | .. |
|---|
| 986 | 987 | if ((size < FM10K_VFMBX_MSG_MTU) || (size & (size + 1))) |
|---|
| 987 | 988 | return FM10K_MBX_ERR_SIZE; |
|---|
| 988 | 989 | |
|---|
| 989 | | - /* fall through */ |
|---|
| 990 | + fallthrough; |
|---|
| 990 | 991 | case FM10K_MSG_ERROR: |
|---|
| 991 | 992 | if (!head || (head == FM10K_MSG_HDR_MASK(HEAD))) |
|---|
| 992 | 993 | return FM10K_MBX_ERR_HEAD; |
|---|
| .. | .. |
|---|
| 1569 | 1570 | mbx->mbmem_reg = FM10K_MBMEM_VF(id, 0); |
|---|
| 1570 | 1571 | break; |
|---|
| 1571 | 1572 | } |
|---|
| 1572 | | - /* fall through */ |
|---|
| 1573 | + fallthrough; |
|---|
| 1573 | 1574 | default: |
|---|
| 1574 | 1575 | return FM10K_MBX_ERR_NO_MBX; |
|---|
| 1575 | 1576 | } |
|---|
| .. | .. |
|---|
| 1920 | 1921 | /* reduce length by 1 to convert to a mask */ |
|---|
| 1921 | 1922 | u16 mbmem_len = mbx->mbmem_len - 1; |
|---|
| 1922 | 1923 | u16 tail_len, len = 0; |
|---|
| 1923 | | - u32 *msg; |
|---|
| 1924 | 1924 | |
|---|
| 1925 | 1925 | /* push head behind tail */ |
|---|
| 1926 | 1926 | if (mbx->tail < head) |
|---|
| .. | .. |
|---|
| 1930 | 1930 | |
|---|
| 1931 | 1931 | /* determine msg aligned offset for end of buffer */ |
|---|
| 1932 | 1932 | do { |
|---|
| 1933 | + u32 *msg; |
|---|
| 1934 | + |
|---|
| 1933 | 1935 | msg = fifo->buffer + fm10k_fifo_head_offset(fifo, len); |
|---|
| 1934 | 1936 | tail_len = len; |
|---|
| 1935 | 1937 | len += FM10K_TLV_DWORD_LEN(*msg); |
|---|
| .. | .. |
|---|
| 2132 | 2134 | * DWORDs, not bytes. Any invalid values will cause the mailbox to return |
|---|
| 2133 | 2135 | * error. |
|---|
| 2134 | 2136 | **/ |
|---|
| 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, |
|---|
| 2136 | 2139 | const struct fm10k_msg_data *msg_data) |
|---|
| 2137 | 2140 | { |
|---|
| 2138 | 2141 | mbx->mbx_reg = FM10K_GMBX; |
|---|