Skip to contentSkip to conversation

wifi: ath12k: duplicate checks

bug report Dan Carpenter 1 participant 1 message Feb 16, 2023 Qualcomm ATH12K wireless driver

lore
Share & tools
lore
#0 lore raw

Hello Kalle Valo,

The patch d889913205cf: "wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices" from Nov 28, 2022, leads to the following Smatch static checker warning:

drivers/net/wireless/ath/ath12k/mac.c:5809 ath12k_mac_op_assign_vif_chanctx() warn: 'arvif->vdev_type == 4' 'false' implies 'arvif->vdev_type != 4' is 'true' drivers/net/wireless/ath/ath12k/dp_rx.c:1369 ath12k_update_per_peer_tx_stats() warn: 'mcs > 11' 'false' implies 'mcs > 11' is 'false' drivers/net/wireless/ath/ath12k/dp_rx.c:1329 ath12k_update_per_peer_tx_stats() warn: address of 'ppdu_stats->user_stats[user]' is non-NULL

drivers/net/wireless/ath/ath12k/mac.c

    5792 
    5793         if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {

type checked here

    5794                 ret = ath12k_mac_monitor_start(ar);
    5795                 if (ret)
    5796                         goto out;
    5797                 arvif->is_started = true;
    5798                 goto out;
    5799         }
    5800 
    5801         ret = ath12k_mac_vdev_start(arvif, &ctx->def);
    5802         if (ret) {
    5803                 ath12k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n",
    5804                             arvif->vdev_id, vif->addr,
    5805                             ctx->def.chan->center_freq, ret);
    5806                 goto out;
    5807         }
    5808 
--> 5809         if (arvif->vdev_type != WMI_VDEV_TYPE_MONITOR && ar->monitor_vdev_created)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

No need to check again

    5810                 ath12k_mac_monitor_start(ar);
    5811 
    5812         arvif->is_started = true;
    5813 
    5814         /* TODO: Setup ps and cts/rts protection */
    5815 
    5816 out:
    5817         mutex_unlock(&ar->conf_mutex);
    5818 
    5819         return ret;
    5820 }

regards,
dan carpenter

Signature · 3 lines
ath12k mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/ath12k