| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl> |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 |
|---|
| 6 | | - * as published by the Free Software Foundation |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | | - * GNU General Public License for more details. |
|---|
| 12 | 4 | */ |
|---|
| 13 | 5 | |
|---|
| 14 | 6 | #include "mt7601u.h" |
|---|
| .. | .. |
|---|
| 124 | 116 | u16 dma_len = get_unaligned_le16(data); |
|---|
| 125 | 117 | |
|---|
| 126 | 118 | if (data_len < min_seg_len || |
|---|
| 127 | | - WARN_ON(!dma_len) || |
|---|
| 128 | | - WARN_ON(dma_len + MT_DMA_HDRS > data_len) || |
|---|
| 129 | | - WARN_ON(dma_len & 0x3)) |
|---|
| 119 | + WARN_ON_ONCE(!dma_len) || |
|---|
| 120 | + WARN_ON_ONCE(dma_len + MT_DMA_HDRS > data_len) || |
|---|
| 121 | + WARN_ON_ONCE(dma_len & 0x3) || |
|---|
| 122 | + WARN_ON_ONCE(dma_len < min_seg_len)) |
|---|
| 130 | 123 | return 0; |
|---|
| 131 | 124 | |
|---|
| 132 | 125 | return MT_DMA_HDRS + dma_len; |
|---|
| .. | .. |
|---|
| 203 | 196 | default: |
|---|
| 204 | 197 | dev_err_ratelimited(dev->dev, "rx urb failed: %d\n", |
|---|
| 205 | 198 | urb->status); |
|---|
| 206 | | - /* fall through */ |
|---|
| 199 | + fallthrough; |
|---|
| 207 | 200 | case 0: |
|---|
| 208 | 201 | break; |
|---|
| 209 | 202 | } |
|---|
| .. | .. |
|---|
| 248 | 241 | default: |
|---|
| 249 | 242 | dev_err_ratelimited(dev->dev, "tx urb failed: %d\n", |
|---|
| 250 | 243 | urb->status); |
|---|
| 251 | | - /* fall through */ |
|---|
| 244 | + fallthrough; |
|---|
| 252 | 245 | case 0: |
|---|
| 253 | 246 | break; |
|---|
| 254 | 247 | } |
|---|