forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/wireless/ath/dfs_pattern_detector.c
....@@ -255,17 +255,15 @@
255255 static void dpd_reset(struct dfs_pattern_detector *dpd)
256256 {
257257 struct channel_detector *cd;
258
- if (!list_empty(&dpd->channel_detectors))
259
- list_for_each_entry(cd, &dpd->channel_detectors, head)
260
- channel_detector_reset(dpd, cd);
258
+ list_for_each_entry(cd, &dpd->channel_detectors, head)
259
+ channel_detector_reset(dpd, cd);
261260
262261 }
263262 static void dpd_exit(struct dfs_pattern_detector *dpd)
264263 {
265264 struct channel_detector *cd, *cd0;
266
- if (!list_empty(&dpd->channel_detectors))
267
- list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head)
268
- channel_detector_exit(dpd, cd);
265
+ list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head)
266
+ channel_detector_exit(dpd, cd);
269267 kfree(dpd);
270268 }
271269
....@@ -333,9 +331,8 @@
333331 return false;
334332
335333 /* delete all channel detectors for previous DFS domain */
336
- if (!list_empty(&dpd->channel_detectors))
337
- list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head)
338
- channel_detector_exit(dpd, cd);
334
+ list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head)
335
+ channel_detector_exit(dpd, cd);
339336 dpd->radar_spec = rt->radar_types;
340337 dpd->num_radar_types = rt->num_radar_types;
341338