[PATCH 0/5] pwrseq: replace magic numbers with defines for match() return values

Bartosz Golaszewski posted 5 patches 3 months, 2 weeks ago
drivers/power/sequencing/Kconfig            |  4 ++--
drivers/power/sequencing/core.c             |  6 +++---
drivers/power/sequencing/pwrseq-qcom-wcn.c  |  8 ++++----
drivers/power/sequencing/pwrseq-thead-gpu.c | 12 +++++++-----
include/linux/pwrseq/provider.h             |  3 +++
5 files changed, 19 insertions(+), 14 deletions(-)
[PATCH 0/5] pwrseq: replace magic numbers with defines for match() return values
Posted by Bartosz Golaszewski 3 months, 2 weeks ago
We currently use 0 or 1 as magic numbers returned from the match()
callback. It's more readable to replace them with proper defines whose
names indicate the meaning. While at it: fix a build issue with the
thead-gpu driver I noticed and extend build coverage for the drivers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Bartosz Golaszewski (5):
      pwrseq: thead-gpu: add missing header
      pwrseq: extend build coverage for pwrseq drivers with COMPILE_TEST=y
      pwrseq: add defines for return values of the match() callback
      pwrseq: qcom-wcn: use new defines for match() return values
      pwrseq: thead-gpu: use new defines for match() return values

 drivers/power/sequencing/Kconfig            |  4 ++--
 drivers/power/sequencing/core.c             |  6 +++---
 drivers/power/sequencing/pwrseq-qcom-wcn.c  |  8 ++++----
 drivers/power/sequencing/pwrseq-thead-gpu.c | 12 +++++++-----
 include/linux/pwrseq/provider.h             |  3 +++
 5 files changed, 19 insertions(+), 14 deletions(-)
---
base-commit: d4c2d9b5b7ceed14a3a835fd969bb0699b9608d3
change-id: 20250624-pwrseq-match-defines-aec46817e69e

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Re: [PATCH 0/5] pwrseq: replace magic numbers with defines for match() return values
Posted by Bartosz Golaszewski 3 months, 1 week ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Tue, 24 Jun 2025 16:32:17 +0200, Bartosz Golaszewski wrote:
> We currently use 0 or 1 as magic numbers returned from the match()
> callback. It's more readable to replace them with proper defines whose
> names indicate the meaning. While at it: fix a build issue with the
> thead-gpu driver I noticed and extend build coverage for the drivers.
> 
> 

Applied with commit subjects tweaked to say "power: sequencing: ...", thanks!

[1/5] pwrseq: thead-gpu: add missing header
      https://git.kernel.org/brgl/linux/c/5bcfc4ef40dabcd16a0b736fea7f0d00a9efdbfb
[2/5] pwrseq: extend build coverage for pwrseq drivers with COMPILE_TEST=y
      https://git.kernel.org/brgl/linux/c/1a7312b93ab023f68b48a1550049a4f850c2c808
[3/5] pwrseq: add defines for return values of the match() callback
      https://git.kernel.org/brgl/linux/c/62b5848f73dd4f8ae17304dae54562d0c9ecdd3d
[4/5] pwrseq: qcom-wcn: use new defines for match() return values
      https://git.kernel.org/brgl/linux/c/f698155029efc708349126c8944fa8c95b28098c
[5/5] pwrseq: thead-gpu: use new defines for match() return values
      https://git.kernel.org/brgl/linux/c/385b735c90ae44dbde65fab76e356a96ff8f67be

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Re: [PATCH 0/5] pwrseq: replace magic numbers with defines for match() return values
Posted by Ulf Hansson 3 months, 2 weeks ago
On Tue, 24 Jun 2025 at 16:32, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> We currently use 0 or 1 as magic numbers returned from the match()
> callback. It's more readable to replace them with proper defines whose
> names indicate the meaning. While at it: fix a build issue with the
> thead-gpu driver I noticed and extend build coverage for the drivers.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> Bartosz Golaszewski (5):
>       pwrseq: thead-gpu: add missing header
>       pwrseq: extend build coverage for pwrseq drivers with COMPILE_TEST=y
>       pwrseq: add defines for return values of the match() callback
>       pwrseq: qcom-wcn: use new defines for match() return values
>       pwrseq: thead-gpu: use new defines for match() return values
>
>  drivers/power/sequencing/Kconfig            |  4 ++--
>  drivers/power/sequencing/core.c             |  6 +++---
>  drivers/power/sequencing/pwrseq-qcom-wcn.c  |  8 ++++----
>  drivers/power/sequencing/pwrseq-thead-gpu.c | 12 +++++++-----
>  include/linux/pwrseq/provider.h             |  3 +++
>  5 files changed, 19 insertions(+), 14 deletions(-)
> ---
> base-commit: d4c2d9b5b7ceed14a3a835fd969bb0699b9608d3
> change-id: 20250624-pwrseq-match-defines-aec46817e69e
>
> Best regards,
> --
> Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>

For the series, feel free to add:

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe