forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/wireless/mediatek/mt7601u/dma.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * 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.
124 */
135
146 #include "mt7601u.h"
....@@ -124,9 +116,10 @@
124116 u16 dma_len = get_unaligned_le16(data);
125117
126118 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))
130123 return 0;
131124
132125 return MT_DMA_HDRS + dma_len;
....@@ -203,7 +196,7 @@
203196 default:
204197 dev_err_ratelimited(dev->dev, "rx urb failed: %d\n",
205198 urb->status);
206
- /* fall through */
199
+ fallthrough;
207200 case 0:
208201 break;
209202 }
....@@ -248,7 +241,7 @@
248241 default:
249242 dev_err_ratelimited(dev->dev, "tx urb failed: %d\n",
250243 urb->status);
251
- /* fall through */
244
+ fallthrough;
252245 case 0:
253246 break;
254247 }