Re: [PATCH v1 1/2] PM: QoS: Rename freq to range constraint

From: Rafael J. Wysocki
Date: Thu Dec 14 2023 - 04:51:14 EST


On Wed, Dec 13, 2023 at 6:58 PM Daniel Lezcano
<daniel.lezcano@xxxxxxxxxx> wrote:
>
> The frequency pm_qos relies on a couple of values, the min and max
> frequencies. However more pm_qos will be added with the same logic of
> a couple of min and max. Instead of writing new set of constraints as
> well as type, etc... let's rename freq_* to a more generic name
> range_*
>
> That way, new qos range based can be added easily.
>
> No functional changes intended.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
> ---

[cut]

> --- a/include/linux/pm_qos.h
> +++ b/include/linux/pm_qos.h
> @@ -77,25 +77,26 @@ struct pm_qos_flags {
> #define FREQ_QOS_MIN_DEFAULT_VALUE 0
> #define FREQ_QOS_MAX_DEFAULT_VALUE S32_MAX
>
> -enum freq_qos_req_type {
> - FREQ_QOS_MIN = 1,
> +enum range_qos_req_type {
> + RANGE_QOS_MIN = 1,
> + RANGE_QOS_MAX,
> + FREQ_QOS_MIN,
> FREQ_QOS_MAX,
> };

I'd rather do:

+enum range_qos_req_type {
+ RANGE_QOS_MIN = 1
+ RANGE_QOS_MAX,
};

+#define FREQ_QOS_MIN RANGE_QOS_MIN
+#define FREQ_QOS_MAX RANGE_QOS_MAX

and they would map exactly.