[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aRIYZOm6ZtpQFr4m@agluck-desk3>
Date: Mon, 10 Nov 2025 08:52:52 -0800
From: "Luck, Tony" <tony.luck@...el.com>
To: Dave Martin <Dave.Martin@....com>
CC: Fenghua Yu <fenghuay@...dia.com>, Reinette Chatre
<reinette.chatre@...el.com>, Maciej Wieczor-Retman
<maciej.wieczor-retman@...el.com>, Peter Newman <peternewman@...gle.com>,
James Morse <james.morse@....com>, Babu Moger <babu.moger@....com>, "Drew
Fustini" <dfustini@...libre.com>, Chen Yu <yu.c.chen@...el.com>,
<x86@...nel.org>, <linux-kernel@...r.kernel.org>, <patches@...ts.linux.dev>
Subject: Re: [PATCH v13 12/32] x86,fs/resctrl: Support binary fixed point
event counters
On Wed, Nov 05, 2025 at 02:42:18PM +0000, Dave Martin wrote:
> > +static void print_event_value(struct seq_file *m, unsigned int binary_bits, u64 val)
> > +{
> > + unsigned long long frac;
> > + char buf[10];
>
> In place of the magic number 10, how about
> decplaces[MAX_BINARY_BITS] + 1 ?
>
> (I think the compiler should accept that as an initialiser if the array
> is const.)
The compiler (gcc 15.2.1) accepts without any warnings. But generates
different code.
sparse complains:
fs/resctrl/ctrlmondata.c:640:45: warning: Variable length array is used.
I may change the hard coded constant to 21 (guaranteed to be big enough
for a "long long" plus terminating NUL byte.)
-Tony
Powered by blists - more mailing lists