Commit 5a391813 authored by Johannes Berg's avatar Johannes Berg Committed by Kalle Valo
Browse files

wifi: zd1211rw: silence sparse warnings



This code wants to compare the obtained value, but as it also
has a special type for register addresses to find places doing
such compares and calculations wrong, we need explicit casts
here to silence sparse.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240223114023.976fcd59e97a.I0bba4ef7dc2847ce8ab5ec229149e1a09413b8b9@changeid
parent e0632430
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ static inline void handle_regs_int(struct urb *urb)
	spin_lock_irqsave(&intr->lock, flags);

	int_num = le16_to_cpu(*(__le16 *)(urb->transfer_buffer+2));
	if (int_num == CR_INTERRUPT) {
	if (int_num == (u16)CR_INTERRUPT) {
		struct zd_mac *mac = zd_hw_mac(zd_usb_to_hw(urb->context));
		spin_lock(&mac->lock);
		memcpy(&mac->intr_buffer, urb->transfer_buffer,
@@ -416,7 +416,8 @@ static inline void handle_regs_int(struct urb *urb)
	spin_unlock_irqrestore(&intr->lock, flags);

	/* CR_INTERRUPT might override read_reg too. */
	if (int_num == CR_INTERRUPT && atomic_read(&intr->read_regs_enabled))
	if (int_num == (u16)CR_INTERRUPT &&
	    atomic_read(&intr->read_regs_enabled))
		handle_regs_int_override(urb);
}