Skip to contentSkip to conversation

wifi: ath12k: unnecessary div_u64()

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/wmi.c:5857 ath12k_chan_info_event() warn: div_u64() expects 'ullong' got 'uint' drivers/net/wireless/ath/ath12k/wmi.c:5858 ath12k_chan_info_event() warn: div_u64() expects 'ullong' got 'uint'

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

    5851         if (ch_info_ev.cmd_flags == WMI_CHAN_INFO_START_RESP) {
    5852                 survey = &ar->survey[idx];
    5853                 memset(survey, 0, sizeof(*survey));
    5854                 survey->noise = le32_to_cpu(ch_info_ev.noise_floor);
    5855                 survey->filled = SURVEY_INFO_NOISE_DBM | SURVEY_INFO_TIME |
    5856                                  SURVEY_INFO_TIME_BUSY;
--> 5857                 survey->time = div_u64(le32_to_cpu(ch_info_ev.cycle_count), cc_freq_hz);
    5858                 survey->time_busy = div_u64(le32_to_cpu(ch_info_ev.rx_clear_count),
    5859                                             cc_freq_hz);

What's the point of using div_u64() on u32 variables?

    5860         }
    5861 exit:
    5862         spin_unlock_bh(&ar->data_lock);
    5863         rcu_read_unlock();
    5864 }

regards,
dan carpenter

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