[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jXv1BHU_m_KebNfLt6ygPDZOnNp+aQk-cDESpDSdbSKQ@mail.gmail.com>
Date: Fri, 22 Dec 2023 16:48:05 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, rjw@...ysocki.net, lukasz.luba@....com,
rui.zhang@...el.com, linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v3 1/2] thermal/debugfs: Add thermal cooling device
debugfs information
On Fri, Dec 22, 2023 at 4:03 PM Daniel Lezcano
<daniel.lezcano@...aro.org> wrote:
>
> On 21/12/2023 18:19, Rafael J. Wysocki wrote:
>
> [ ... ]
>
> >> +struct cdev_value {
> >
> > I'm not sure about the name here. I would rather call it cdev_record,
> > because it consists of two items, the id and the value.
> >
> >> + struct list_head node;
> >> + int id;
> >> + u64 value;
> >
> > This is kind of a union, but sort of in disguise.
> >
> > Why not make it a union proper, that is
> >
> > struct cdev_record {
> > struct list_head node;
> > int id;
> > union {
> > krime_t residency; /* for duration records */
> > u64 count; /* for occurrences records */
> > } data;
> > };
> >
> > which then would result in a bit cleaner code in some places below, if
> > I'm not mistaken?
>
> Can we stick to
>
> struct cdev_record {
> struct list_head node;
> int id;
> union {
> u64 residency_ms; <----- ?
> u64 count;
> };
> };
>
> ?
>
> The usage of the ktime_t will have a more important impact in the code.
OK, but patch [2/2] uses ktime_t for duration computations regarding
trip points. I'm not sure why this is different.
Powered by blists - more mailing lists