public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: quic_kvalo@quicinc.com
Cc: ath12k@lists.infradead.org
Subject: [bug report] wifi: ath12k: unnecessary div_u64()
Date: Thu, 16 Feb 2023 17:00:55 +0300	[thread overview]
Message-ID: <Y+43F8dEinSr04hW@kili> (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

-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

                 reply	other threads:[~2023-02-16 14:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+43F8dEinSr04hW@kili \
    --to=error27@gmail.com \
    --cc=ath12k@lists.infradead.org \
    --cc=quic_kvalo@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox