Skip to content

Commit 4511555

Browse files
committed
Merge branch 'sfx-fixes'
Edward Cree says: ==================== sfc: couple of fixes First patch addresses a construct that causes sparse to error out. With that fixed, sparse makes some warnings on ef10.c, second patch fixes one of them. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 48051c3 + 6d43131 commit 4511555

File tree

1 file changed

+6
-6
lines changed
  • drivers/net/ethernet/sfc

1 file changed

+6
-6
lines changed

drivers/net/ethernet/sfc/ef10.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,7 @@ static int efx_ef10_alloc_piobufs(struct efx_nic *efx, unsigned int n)
828828
static int efx_ef10_link_piobufs(struct efx_nic *efx)
829829
{
830830
struct efx_ef10_nic_data *nic_data = efx->nic_data;
831-
_MCDI_DECLARE_BUF(inbuf,
832-
max(MC_CMD_LINK_PIOBUF_IN_LEN,
833-
MC_CMD_UNLINK_PIOBUF_IN_LEN));
831+
MCDI_DECLARE_BUF(inbuf, MC_CMD_LINK_PIOBUF_IN_LEN);
834832
struct efx_channel *channel;
835833
struct efx_tx_queue *tx_queue;
836834
unsigned int offset, index;
@@ -839,8 +837,6 @@ static int efx_ef10_link_piobufs(struct efx_nic *efx)
839837
BUILD_BUG_ON(MC_CMD_LINK_PIOBUF_OUT_LEN != 0);
840838
BUILD_BUG_ON(MC_CMD_UNLINK_PIOBUF_OUT_LEN != 0);
841839

842-
memset(inbuf, 0, sizeof(inbuf));
843-
844840
/* Link a buffer to each VI in the write-combining mapping */
845841
for (index = 0; index < nic_data->n_piobufs; ++index) {
846842
MCDI_SET_DWORD(inbuf, LINK_PIOBUF_IN_PIOBUF_HANDLE,
@@ -920,6 +916,10 @@ static int efx_ef10_link_piobufs(struct efx_nic *efx)
920916
return 0;
921917

922918
fail:
919+
/* inbuf was defined for MC_CMD_LINK_PIOBUF. We can use the same
920+
* buffer for MC_CMD_UNLINK_PIOBUF because it's shorter.
921+
*/
922+
BUILD_BUG_ON(MC_CMD_LINK_PIOBUF_IN_LEN < MC_CMD_UNLINK_PIOBUF_IN_LEN);
923923
while (index--) {
924924
MCDI_SET_DWORD(inbuf, UNLINK_PIOBUF_IN_TXQ_INSTANCE,
925925
nic_data->pio_write_vi_base + index);
@@ -2183,7 +2183,7 @@ static int efx_ef10_tx_tso_desc(struct efx_tx_queue *tx_queue,
21832183
/* Modify IPv4 header if needed. */
21842184
ip->tot_len = 0;
21852185
ip->check = 0;
2186-
ipv4_id = ip->id;
2186+
ipv4_id = ntohs(ip->id);
21872187
} else {
21882188
/* Modify IPv6 header if needed. */
21892189
struct ipv6hdr *ipv6 = ipv6_hdr(skb);

0 commit comments

Comments
 (0)