mt7601u: do not use WARN_ON in the datapath
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Tue, 22 Jan 2019 15:39:34 +0000 (16:39 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 1 Feb 2019 12:41:19 +0000 (14:41 +0200)
Substitute WARN_ON with WARN_ON_ONCE in mt7601u_rx_next_seg_len
routine

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt7601u/dma.c

index 7f3e3983b781d72af83b0fc47006b1a2ff34078c..f7edeffb2b19179fb166add88039755234d79bc8 100644 (file)
@@ -124,9 +124,9 @@ static u16 mt7601u_rx_next_seg_len(u8 *data, u32 data_len)
        u16 dma_len = get_unaligned_le16(data);
 
        if (data_len < min_seg_len ||
-           WARN_ON(!dma_len) ||
-           WARN_ON(dma_len + MT_DMA_HDRS > data_len) ||
-           WARN_ON(dma_len & 0x3))
+           WARN_ON_ONCE(!dma_len) ||
+           WARN_ON_ONCE(dma_len + MT_DMA_HDRS > data_len) ||
+           WARN_ON_ONCE(dma_len & 0x3))
                return 0;
 
        return MT_DMA_HDRS + dma_len;