From: Shuah Khan <skhan@linuxfoundation.org>
To: Niko Nikolov <nikolay.niko.nikolov@gmail.com>,
shuah@kernel.org, linux-kernel@vger.kernel.org
Cc: Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] x86/tsc: Replace do_div() with div64_u64()/div64_ul()
Date: Thu, 24 Jul 2025 16:32:43 -0600 [thread overview]
Message-ID: <c6eb6734-93d3-4a59-8869-49ecc438fff9@linuxfoundation.org> (raw)
In-Reply-To: <20250724215339.11390-1-nikolay.niko.nikolov@gmail.com>
On 7/24/25 15:53, Niko Nikolov wrote:
> Replace do_div() with the recommended division helpers to avoid
> truncation and follow kernel best practices, as flagged by static
> analysis.
You are making more changes than what change log indicates.
>
> ./arch/x86/kernel/tsc.c:409:1-7:
> WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead.
> ./arch/x86/kernel/tsc.c:492:1-7:
> WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead.
> ./arch/x86/kernel/tsc.c:831:2-8:
> WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead.
It is hard to see where you are addressing the above warnings with all
the other changes.
Also you don't have the right reviewers cc'ed
>
> Signed-off-by: Niko Nikolov <nikolay.niko.nikolov@gmail.com>
> ---
> arch/x86/kernel/tsc.c | 185 +++++++++++++++++++++---------------------
> 1 file changed, 91 insertions(+), 94 deletions(-)
>
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 87e749106dda..96f40759340e 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -34,13 +34,13 @@
> #include <asm/uv/uv.h>
> #include <asm/sev.h>
>
> -unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
> +unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
> EXPORT_SYMBOL(cpu_khz);
>
> unsigned int __read_mostly tsc_khz;
> EXPORT_SYMBOL(tsc_khz);
>
> -#define KHZ 1000
> +#define KHZ 1000
What changed here?
>
> /*
> * TSC can be unstable due to cpufreq or due to unsynced TSCs
> @@ -55,13 +55,13 @@ int tsc_clocksource_reliable;
> static int __read_mostly tsc_force_recalibrate;
>
> static struct clocksource_base art_base_clk = {
> - .id = CSID_X86_ART,
> + .id = CSID_X86_ART,
Tabs removed? Why?
> };
> static bool have_art;
>
Same questions for the rest of the format changes.
thanks,
-- Shuah
next prev parent reply other threads:[~2025-07-24 22:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 21:53 Niko Nikolov
2025-07-24 22:32 ` Shuah Khan [this message]
2025-07-28 19:06 ` David Laight
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=c6eb6734-93d3-4a59-8869-49ecc438fff9@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nikolay.niko.nikolov@gmail.com \
--cc=shuah@kernel.org \
/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
all inboxes | Powered by JetHome®