[PATCH] power: supply: max17042_battery: Do not use CONFIG_ prefix in regular C code

Przemyslaw posted 1 patch 2 years, 6 months ago
drivers/power/supply/max17042_battery.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] power: supply: max17042_battery: Do not use CONFIG_ prefix in regular C code
Posted by Przemyslaw 2 years, 6 months ago
From: Przemyslaw Chwiala <przemekchwiala@gmail.com>

Using CONFIG_ prefix for macros is not a good practice.
Use CONFIG_ prefix in Kconfig only.

Signed-off-by: Przemyslaw Chwiala <przemekchwiala@gmail.com>
---
 drivers/power/supply/max17042_battery.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index 17ac2ab78c4e..e7d37e422c3f 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -36,7 +36,7 @@
 #define STATUS_BR_BIT          (1 << 15)
 
 /* Interrupt mask bits */
-#define CONFIG_ALRT_BIT_ENBL	(1 << 2)
+#define CFG_ALRT_BIT_ENBL	(1 << 2)
 
 #define VFSOC0_LOCK		0x0000
 #define VFSOC0_UNLOCK		0x0080
@@ -1116,8 +1116,8 @@ static int max17042_probe(struct i2c_client *client)
 						chip);
 		if (!ret) {
 			regmap_update_bits(chip->regmap, MAX17042_CONFIG,
-					CONFIG_ALRT_BIT_ENBL,
-					CONFIG_ALRT_BIT_ENBL);
+					CFG_ALRT_BIT_ENBL,
+					CFG_ALRT_BIT_ENBL);
 			max17042_set_soc_threshold(chip, 1);
 		} else {
 			client->irq = 0;
-- 
2.25.1
Re: [PATCH] power: supply: max17042_battery: Do not use CONFIG_ prefix in regular C code
Posted by Sebastian Reichel 2 years, 4 months ago
On Thu, 20 Jul 2023 14:31:02 +0200, Przemyslaw wrote:
> Using CONFIG_ prefix for macros is not a good practice.
> Use CONFIG_ prefix in Kconfig only.
> 
> 

Applied, thanks!

[1/1] power: supply: max17042_battery: Do not use CONFIG_ prefix in regular C code
      commit: c06a65ac4e4945478f46654920f5af1be1cf384e

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>
Re: [PATCH] power: supply: max17042_battery: Do not use CONFIG_ prefix in regular C code
Posted by Lukas Bulwahn 2 years, 6 months ago
On Thu, Jul 20, 2023 at 2:33 PM Przemyslaw <przemekchwiala@gmail.com> wrote:
>
> From: Przemyslaw Chwiala <przemekchwiala@gmail.com>
>
> Using CONFIG_ prefix for macros is not a good practice.
> Use CONFIG_ prefix in Kconfig only.
>

Przemyslaw, thanks for the clean up of kernel config references. One
less to go on my clean-up list.

Reviewed-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

Lukas

> Signed-off-by: Przemyslaw Chwiala <przemekchwiala@gmail.com>
> ---
>  drivers/power/supply/max17042_battery.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
> index 17ac2ab78c4e..e7d37e422c3f 100644
> --- a/drivers/power/supply/max17042_battery.c
> +++ b/drivers/power/supply/max17042_battery.c
> @@ -36,7 +36,7 @@
>  #define STATUS_BR_BIT          (1 << 15)
>
>  /* Interrupt mask bits */
> -#define CONFIG_ALRT_BIT_ENBL   (1 << 2)
> +#define CFG_ALRT_BIT_ENBL      (1 << 2)
>
>  #define VFSOC0_LOCK            0x0000
>  #define VFSOC0_UNLOCK          0x0080
> @@ -1116,8 +1116,8 @@ static int max17042_probe(struct i2c_client *client)
>                                                 chip);
>                 if (!ret) {
>                         regmap_update_bits(chip->regmap, MAX17042_CONFIG,
> -                                       CONFIG_ALRT_BIT_ENBL,
> -                                       CONFIG_ALRT_BIT_ENBL);
> +                                       CFG_ALRT_BIT_ENBL,
> +                                       CFG_ALRT_BIT_ENBL);
>                         max17042_set_soc_threshold(chip, 1);
>                 } else {
>                         client->irq = 0;
> --
> 2.25.1
>
Re: [PATCH] power: supply: max17042_battery: Do not use CONFIG_ prefix in regular C code
Posted by Krzysztof Kozlowski 2 years, 6 months ago
On 20/07/2023 14:31, Przemyslaw wrote:
> From: Przemyslaw Chwiala <przemekchwiala@gmail.com>
> 
> Using CONFIG_ prefix for macros is not a good practice.
> Use CONFIG_ prefix in Kconfig only.
> 
> Signed-off-by: Przemyslaw Chwiala <przemekchwiala@gmail.com>
> ---

For future:
Please provide changelog after --- and version your patches (git
format-patch -v2, or use b4).


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


---

This is an automated instruction, just in case, because many review tags
are being ignored. If you do not know the process, here is a short
explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new
versions, under or above your Signed-off-by tag. Tag is "received", when
provided in a message replied to you on the mailing list. Tools like b4
can help here. However, there's no need to repost patches *only* to add
the tags. The upstream maintainer will do that for acks received on the
version they apply.

https://elixir.bootlin.com/linux/v5.17/source/Documentation/process/submitting-patches.rst#L540

Best regards,
Krzysztof