Skip to content

Commit

Permalink
wifi: ath6kl: fix sparse warnings
Browse files Browse the repository at this point in the history
Sparse warns:

drivers/net/wireless/ath/ath6kl/htc_pipe.c:241:17: warning: incorrect type in assignment (different base types)
drivers/net/wireless/ath/ath6kl/htc_pipe.c:241:17:    expected restricted __le16 x
drivers/net/wireless/ath/ath6kl/htc_pipe.c:241:17:    got unsigned short [usertype]
drivers/net/wireless/ath/ath6kl/htc_mbox.c:368:9: warning: incorrect type in assignment (different base types)
drivers/net/wireless/ath/ath6kl/htc_mbox.c:368:9:    expected restricted __le16 x
drivers/net/wireless/ath/ath6kl/htc_mbox.c:368:9:    got unsigned short [usertype]

Use put_unaligned_le16() so that the value is converted to little endian before
storing it to the header.

Compile tested only.

Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
  • Loading branch information
kvalo committed Mar 25, 2024
1 parent fa1a4f1 commit ed76931
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/ath/ath6kl/htc_mbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,7 @@ static void ath6kl_htc_tx_prep_pkt(struct htc_packet *packet, u8 flags,
packet->buf -= HTC_HDR_LENGTH;
hdr = (struct htc_frame_hdr *)packet->buf;

/* Endianess? */
put_unaligned((u16)packet->act_len, &hdr->payld_len);
put_unaligned_le16(packet->act_len, &hdr->payld_len);
hdr->flags = flags;
hdr->eid = packet->endpoint;
hdr->ctrl[0] = ctrl0;
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/ath/ath6kl/htc_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ static int htc_issue_packets(struct htc_target *target,

packet->info.tx.flags |= HTC_FLAGS_TX_FIXUP_NETBUF;

/* Endianess? */
put_unaligned((u16) payload_len, &htc_hdr->payld_len);
put_unaligned_le16(payload_len, &htc_hdr->payld_len);
htc_hdr->flags = packet->info.tx.flags;
htc_hdr->eid = (u8) packet->endpoint;
htc_hdr->ctrl[0] = 0;
Expand Down

0 comments on commit ed76931

Please sign in to comment.