Skip to content

Commit

Permalink
mt7601u: do not use WARN_ON in the datapath
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lorenzo Bianconi authored and Kalle Valo committed Feb 1, 2019
1 parent a0b449d commit b6958ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wireless/mediatek/mt7601u/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b6958ad

Please sign in to comment.