From: Christian Lamparter Date: Thu, 15 Apr 2010 12:17:07 +0000 (+0200) Subject: p54pci: fix serious sparse warning X-Git-Tag: MMI-PSA29.97-13-9~23873^2~167^2~284 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=103823db62ffca028c7a214c80266519d2ea7d8d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git p54pci: fix serious sparse warning This patch fixes a bug which was just recently introduced by ("p54pci: prevent stuck rx-ring on slow system"). make M=drivers/net/wireless/p54 C=2 CF=-D__CHECK_ENDIAN__ CHECK drivers/net/wireless/p54/p54pci.c drivers/net/wireless/p54/p54pci.c:143:11: warning: cast to restricted __le32 CC [M] drivers/net/wireless/p54/p54pci.o Reported-by: Johannes Berg Signed-off-by: Christian Lamparter Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index aa29663bf6c9..0a516c8efd20 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c @@ -139,7 +139,7 @@ static void p54p_refill_rx_ring(struct ieee80211_hw *dev, idx = le32_to_cpu(ring_control->host_idx[ring_index]); limit = idx; - limit -= le32_to_cpu(index); + limit -= index; limit = ring_limit - limit; i = idx % ring_limit;