2018-08-04 21:49:25

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 00/12] ASoC: codecs: use true and false for boolean values

Hi all,

This patchset aims to replace the use of integer values with a
proper true or false in return statements for functions returning
bool.

Thanks

Gustavo A. R. Silva (12):
ASoC: max9850: use true and false for boolean values
ASoC: rt5631: use true and false for boolean values
ASoC: tda7419: use true and false for boolean values
ASoC: wm8990: use true and false for boolean values
ASoC: cs4270: use true and false for boolean values
ASoC: wm8996: use true and false for boolean values
ASoC: da7219: use true and false for boolean values
ASoC: twl6040: use true and false for boolean values
ASoC: da7213: use true and false for boolean values
ASoC: wm5100-tables: use true and false for boolean values
ASoC: da9055: use true and false for boolean values
ASoC: wm8903: use true and false for boolean values

sound/soc/codecs/cs4270.c | 2 +-
sound/soc/codecs/da7213.c | 4 ++--
sound/soc/codecs/da7219.c | 4 ++--
sound/soc/codecs/da9055.c | 4 ++--
sound/soc/codecs/max9850.c | 4 ++--
sound/soc/codecs/rt5631.c | 8 ++++----
sound/soc/codecs/tda7419.c | 4 ++--
sound/soc/codecs/twl6040.c | 2 +-
sound/soc/codecs/wm5100-tables.c | 12 ++++++------
sound/soc/codecs/wm8903.c | 4 ++--
sound/soc/codecs/wm8990.c | 4 ++--
sound/soc/codecs/wm8996.c | 8 ++++----
12 files changed, 30 insertions(+), 30 deletions(-)

--
2.7.4



2018-08-04 21:51:36

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 02/12] ASoC: rt5631: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/rt5631.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c
index e52e467..865f49a 100644
--- a/sound/soc/codecs/rt5631.c
+++ b/sound/soc/codecs/rt5631.c
@@ -105,9 +105,9 @@ static bool rt5631_volatile_register(struct device *dev, unsigned int reg)
case RT5631_INDEX_ADD:
case RT5631_INDEX_DATA:
case RT5631_EQ_CTRL:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

@@ -164,9 +164,9 @@ static bool rt5631_readable_register(struct device *dev, unsigned int reg)
case RT5631_VENDOR_ID:
case RT5631_VENDOR_ID1:
case RT5631_VENDOR_ID2:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-04 21:51:48

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 01/12] ASoC: max9850: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/max9850.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/max9850.c b/sound/soc/codecs/max9850.c
index 74d7f52..6e61345 100644
--- a/sound/soc/codecs/max9850.c
+++ b/sound/soc/codecs/max9850.c
@@ -52,9 +52,9 @@ static bool max9850_volatile_register(struct device *dev, unsigned int reg)
switch (reg) {
case MAX9850_STATUSA:
case MAX9850_STATUSB:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-04 21:52:05

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 03/12] ASoC: tda7419: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/tda7419.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/tda7419.c b/sound/soc/codecs/tda7419.c
index 225c210..7f3b79c 100644
--- a/sound/soc/codecs/tda7419.c
+++ b/sound/soc/codecs/tda7419.c
@@ -142,9 +142,9 @@ struct tda7419_vol_control {
static inline bool tda7419_vol_is_stereo(struct tda7419_vol_control *tvc)
{
if (tvc->reg == tvc->rreg)
- return 0;
+ return false;

- return 1;
+ return true;
}

static int tda7419_vol_info(struct snd_kcontrol *kcontrol,
--
2.7.4


2018-08-04 21:53:25

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 04/12] ASoC: wm8990: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/wm8990.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index 411b9ee..457bc43 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -40,9 +40,9 @@ static bool wm8990_volatile_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case WM8990_RESET:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-04 21:54:09

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 06/12] ASoC: wm8996: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/wm8996.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index 78a4082..91711f8 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -1498,9 +1498,9 @@ static bool wm8996_readable_register(struct device *dev, unsigned int reg)
case WM8996_RIGHT_PDM_SPEAKER:
case WM8996_PDM_SPEAKER_MUTE_SEQUENCE:
case WM8996_PDM_SPEAKER_VOLUME:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

@@ -1522,9 +1522,9 @@ static bool wm8996_volatile_register(struct device *dev, unsigned int reg)
case WM8996_MIC_DETECT_3:
case WM8996_HEADPHONE_DETECT_1:
case WM8996_HEADPHONE_DETECT_2:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-04 21:54:24

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 05/12] ASoC: cs4270: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/cs4270.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 2a7a416..3c266ee 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -219,7 +219,7 @@ static bool cs4270_reg_is_volatile(struct device *dev, unsigned int reg)
{
/* Unreadable registers are considered volatile */
if ((reg < CS4270_FIRSTREG) || (reg > CS4270_LASTREG))
- return 1;
+ return true;

return reg == CS4270_CHIPID;
}
--
2.7.4


2018-08-04 21:54:28

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 07/12] ASoC: da7219: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/da7219.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 980a6a8..c0144f2 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -2143,9 +2143,9 @@ static bool da7219_volatile_register(struct device *dev, unsigned int reg)
case DA7219_ACCDET_IRQ_EVENT_B:
case DA7219_ACCDET_CONFIG_8:
case DA7219_SYSTEM_STATUS:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-04 21:55:22

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 08/12] ASoC: twl6040: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/twl6040.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index bfd1abd..94675da 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -148,7 +148,7 @@ static bool twl6040_can_write_to_chip(struct snd_soc_component *component,
case TWL6040_REG_HFRCTL:
return priv->dl2_unmuted;
default:
- return 1;
+ return true;
}
}

--
2.7.4


2018-08-04 21:55:32

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 09/12] ASoC: da7213: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/da7213.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c
index 54cb5f2..92d006a 100644
--- a/sound/soc/codecs/da7213.c
+++ b/sound/soc/codecs/da7213.c
@@ -1140,9 +1140,9 @@ static bool da7213_volatile_register(struct device *dev, unsigned int reg)
case DA7213_ALC_OFFSET_AUTO_M_R:
case DA7213_ALC_OFFSET_AUTO_U_R:
case DA7213_ALC_CIC_OP_LVL_DATA:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-04 21:56:33

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 10/12] ASoC: wm5100-tables: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/wm5100-tables.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/wm5100-tables.c b/sound/soc/codecs/wm5100-tables.c
index e239f4b..9e987cf 100644
--- a/sound/soc/codecs/wm5100-tables.c
+++ b/sound/soc/codecs/wm5100-tables.c
@@ -30,7 +30,7 @@ bool wm5100_volatile_register(struct device *dev, unsigned int reg)
case WM5100_OUTPUT_STATUS_2:
case WM5100_INPUT_ENABLES_STATUS:
case WM5100_MIC_DETECT_3:
- return 1;
+ return true;
default:
if ((reg >= WM5100_DSP1_PM_0 && reg <= WM5100_DSP1_PM_1535) ||
(reg >= WM5100_DSP1_ZM_0 && reg <= WM5100_DSP1_ZM_2047) ||
@@ -41,9 +41,9 @@ bool wm5100_volatile_register(struct device *dev, unsigned int reg)
(reg >= WM5100_DSP3_PM_0 && reg <= WM5100_DSP3_PM_1535) ||
(reg >= WM5100_DSP3_ZM_0 && reg <= WM5100_DSP3_ZM_2047) ||
(reg >= WM5100_DSP3_DM_0 && reg <= WM5100_DSP3_DM_511))
- return 1;
+ return true;
else
- return 0;
+ return false;
}
}

@@ -798,7 +798,7 @@ bool wm5100_readable_register(struct device *dev, unsigned int reg)
case WM5100_DSP3_CONTROL_28:
case WM5100_DSP3_CONTROL_29:
case WM5100_DSP3_CONTROL_30:
- return 1;
+ return true;
default:
if ((reg >= WM5100_DSP1_PM_0 && reg <= WM5100_DSP1_PM_1535) ||
(reg >= WM5100_DSP1_ZM_0 && reg <= WM5100_DSP1_ZM_2047) ||
@@ -809,9 +809,9 @@ bool wm5100_readable_register(struct device *dev, unsigned int reg)
(reg >= WM5100_DSP3_PM_0 && reg <= WM5100_DSP3_PM_1535) ||
(reg >= WM5100_DSP3_ZM_0 && reg <= WM5100_DSP3_ZM_2047) ||
(reg >= WM5100_DSP3_DM_0 && reg <= WM5100_DSP3_DM_511))
- return 1;
+ return true;
else
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-04 21:57:04

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 11/12] ASoC: da9055: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/da9055.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c
index afdf90c..f6a7bf9 100644
--- a/sound/soc/codecs/da9055.c
+++ b/sound/soc/codecs/da9055.c
@@ -1041,9 +1041,9 @@ static bool da9055_volatile_register(struct device *dev,
case DA9055_HP_R_GAIN_STATUS:
case DA9055_LINE_GAIN_STATUS:
case DA9055_ALC_CIC_OP_LVL_DATA:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-04 21:57:39

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 12/12] ASoC: wm8903: use true and false for boolean values

Return statements in functions returning bool should use true or false
instead of an integer value.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
sound/soc/codecs/wm8903.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 7b8b6ef..6cb3c15 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -251,10 +251,10 @@ static bool wm8903_volatile_register(struct device *dev, unsigned int reg)
case WM8903_DC_SERVO_READBACK_2:
case WM8903_DC_SERVO_READBACK_3:
case WM8903_DC_SERVO_READBACK_4:
- return 1;
+ return true;

default:
- return 0;
+ return false;
}
}

--
2.7.4


2018-08-06 09:43:57

by Charles Keepax

[permalink] [raw]
Subject: Re: [PATCH 06/12] ASoC: wm8996: use true and false for boolean values

On Sat, Aug 04, 2018 at 04:52:35PM -0500, Gustavo A. R. Silva wrote:
> Return statements in functions returning bool should use true or false
> instead of an integer value.
>
> This code was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---

Acked-by: Charles Keepax <[email protected]>

Thanks,
Charles

2018-08-06 09:44:49

by Charles Keepax

[permalink] [raw]
Subject: Re: [PATCH 10/12] ASoC: wm5100-tables: use true and false for boolean values

On Sat, Aug 04, 2018 at 04:54:54PM -0500, Gustavo A. R. Silva wrote:
> Return statements in functions returning bool should use true or false
> instead of an integer value.
>
> This code was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---

Acked-by: Charles Keepax <[email protected]>

Thanks,
Charles

2018-08-06 09:45:07

by Charles Keepax

[permalink] [raw]
Subject: Re: [PATCH 12/12] ASoC: wm8903: use true and false for boolean values

On Sat, Aug 04, 2018 at 04:56:02PM -0500, Gustavo A. R. Silva wrote:
> Return statements in functions returning bool should use true or false
> instead of an integer value.
>
> This code was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---

Acked-by: Charles Keepax <[email protected]>

Thanks,
Charles

2018-08-06 09:49:15

by Charles Keepax

[permalink] [raw]
Subject: Re: [PATCH 04/12] ASoC: wm8990: use true and false for boolean values

On Sat, Aug 04, 2018 at 04:51:01PM -0500, Gustavo A. R. Silva wrote:
> Return statements in functions returning bool should use true or false
> instead of an integer value.
>
> This code was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---

Acked-by: Charles Keepax <[email protected]>

Thanks,
Charles