lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa8628c7-f49a-4226-b26e-ada31316b130@linaro.org>
Date: Fri, 22 Dec 2023 16:03:41 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: 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 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.



-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ