diff mbox

[05/19] media: Change variable type to bool

Message ID 1379802471-30252-5-git-send-email-peter.senna@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Senna Tschudin Sept. 21, 2013, 10:27 p.m. UTC
The variable vco_select is only assigned the values true and false.
Change its type to bool.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@exists@
type T;
identifier b;
@@
- T
+ bool
  b = ...;
  ... when any
  b = \(true\|false\)

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
 drivers/media/tuners/fc0012.c | 2 +-
 drivers/media/tuners/fc0013.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Hans-Frieder Vogt Sept. 28, 2013, 9:39 a.m. UTC | #1
Am Sonntag, 22. September 2013, 00:27:37 schrieb Peter Senna Tschudin:
> The variable vco_select is only assigned the values true and false.
> Change its type to bool.
> 
> The simplified semantic patch that find this problem is as
> follows (http://coccinelle.lip6.fr/):
> 
> @exists@
> type T;
> identifier b;
> @@
> - T
> + bool
>   b = ...;
>   ... when any
>   b = \(true\|false\)
> 
> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
> ---
>  drivers/media/tuners/fc0012.c | 2 +-
>  drivers/media/tuners/fc0013.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c
> index f4d0e79..d74e920 100644
> --- a/drivers/media/tuners/fc0012.c
> +++ b/drivers/media/tuners/fc0012.c
> @@ -139,7 +139,7 @@ static int fc0012_set_params(struct dvb_frontend *fe)
>  	unsigned char reg[7], am, pm, multi, tmp;
>  	unsigned long f_vco;
>  	unsigned short xtal_freq_khz_2, xin, xdiv;
> -	int vco_select = false;
> +	bool vco_select = false;
> 
>  	if (fe->callback) {
>  		ret = fe->callback(priv->i2c, DVB_FRONTEND_COMPONENT_TUNER,
> diff --git a/drivers/media/tuners/fc0013.c b/drivers/media/tuners/fc0013.c
> index bd8f0f1..b416231 100644
> --- a/drivers/media/tuners/fc0013.c
> +++ b/drivers/media/tuners/fc0013.c
> @@ -233,7 +233,7 @@ static int fc0013_set_params(struct dvb_frontend *fe)
>  	unsigned char reg[7], am, pm, multi, tmp;
>  	unsigned long f_vco;
>  	unsigned short xtal_freq_khz_2, xin, xdiv;
> -	int vco_select = false;
> +	bool vco_select = false;
> 
>  	if (fe->callback) {
>  		ret = fe->callback(priv->i2c, DVB_FRONTEND_COMPONENT_TUNER,

Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>

Hans-Frieder Vogt                       e-mail: hfvogt <at> gmx .dot. net

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c
index f4d0e79..d74e920 100644
--- a/drivers/media/tuners/fc0012.c
+++ b/drivers/media/tuners/fc0012.c
@@ -139,7 +139,7 @@  static int fc0012_set_params(struct dvb_frontend *fe)
 	unsigned char reg[7], am, pm, multi, tmp;
 	unsigned long f_vco;
 	unsigned short xtal_freq_khz_2, xin, xdiv;
-	int vco_select = false;
+	bool vco_select = false;
 
 	if (fe->callback) {
 		ret = fe->callback(priv->i2c, DVB_FRONTEND_COMPONENT_TUNER,
diff --git a/drivers/media/tuners/fc0013.c b/drivers/media/tuners/fc0013.c
index bd8f0f1..b416231 100644
--- a/drivers/media/tuners/fc0013.c
+++ b/drivers/media/tuners/fc0013.c
@@ -233,7 +233,7 @@  static int fc0013_set_params(struct dvb_frontend *fe)
 	unsigned char reg[7], am, pm, multi, tmp;
 	unsigned long f_vco;
 	unsigned short xtal_freq_khz_2, xin, xdiv;
-	int vco_select = false;
+	bool vco_select = false;
 
 	if (fe->callback) {
 		ret = fe->callback(priv->i2c, DVB_FRONTEND_COMPONENT_TUNER,