diff mbox series

[04/11] media: ttpci: checkpatch fixes: braces

Message ID 20240328020522.50995-5-herdler@nurfuerspam.de (mailing list archive)
State New
Headers show
Series media: ttpci: make checkpatch happy | expand

Commit Message

Stefan Herdler March 28, 2024, 2:05 a.m. UTC
This patch fixes the following checkpatch warnings and errors:

WARNING:BRACES: braces {} are not necessary for any arm of this statement
WARNING:BRACES: braces {} are not necessary for single statement blocks
ERROR:OPEN_BRACE: that open brace { should be on the previous line


Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
---

 drivers/media/pci/ttpci/budget-av.c | 31 ++++++++++-------------------
 drivers/media/pci/ttpci/budget-ci.c | 17 ++++++----------
 drivers/media/pci/ttpci/budget.c    |  9 +++------
 3 files changed, 20 insertions(+), 37 deletions(-)

--
2.34.0

Comments

Hans Verkuil April 8, 2024, 2:47 p.m. UTC | #1
On 28/03/2024 03:05, Stefan Herdler wrote:
> This patch fixes the following checkpatch warnings and errors:
> 
> WARNING:BRACES: braces {} are not necessary for any arm of this statement
> WARNING:BRACES: braces {} are not necessary for single statement blocks
> ERROR:OPEN_BRACE: that open brace { should be on the previous line
> 
> 
> Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
> ---
> 
>  drivers/media/pci/ttpci/budget-av.c | 31 ++++++++++-------------------
>  drivers/media/pci/ttpci/budget-ci.c | 17 ++++++----------
>  drivers/media/pci/ttpci/budget.c    |  9 +++------
>  3 files changed, 20 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c
> index dbd4ef40e..2faea2861 100644
> --- a/drivers/media/pci/ttpci/budget-av.c
> +++ b/drivers/media/pci/ttpci/budget-av.c
> @@ -309,16 +309,14 @@ static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open
>  	/* read from attribute memory in reset/ready state to know when the CAM is ready */
>  	if (budget_av->slot_status == SLOTSTATUS_RESET) {
>  		result = ciintf_read_attribute_mem(ca, slot, 0);
> -		if (result == 0x1d) {
> +		if (result == 0x1d)
>  			budget_av->slot_status = SLOTSTATUS_READY;
> -		}
>  	}
> 
>  	/* work out correct return code */
>  	if (budget_av->slot_status != SLOTSTATUS_NONE) {
> -		if (budget_av->slot_status & SLOTSTATUS_READY) {
> +		if (budget_av->slot_status & SLOTSTATUS_READY)
>  			return DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY;
> -		}
>  		return DVB_CA_EN50221_POLL_CAM_PRESENT;
>  	}
>  	return 0;
> @@ -1237,15 +1235,13 @@ static void frontend_init(struct budget_av *budget_av)
>  		if (saa->pci->subsystem_vendor == 0x1894) {
>  			fe = dvb_attach(stv0299_attach, &cinergy_1200s_1894_0010_config,
>  					     &budget_av->budget.i2c_adap);
> -			if (fe) {
> +			if (fe)
>  				dvb_attach(tua6100_attach, fe, 0x60, &budget_av->budget.i2c_adap);
> -			}
>  		} else {
>  			fe = dvb_attach(stv0299_attach, &typhoon_config,
>  					     &budget_av->budget.i2c_adap);
> -			if (fe) {
> +			if (fe)
>  				fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
> -			}
>  		}
>  		break;
> 
> @@ -1257,19 +1253,17 @@ static void frontend_init(struct budget_av *budget_av)
>  	case SUBID_DVBS_EASYWATCH_2:
>  		fe = dvb_attach(stv0299_attach, &philips_sd1878_config,
>  				&budget_av->budget.i2c_adap);
> -		if (fe) {
> +		if (fe)
>  			dvb_attach(dvb_pll_attach, fe, 0x60,
>  				   &budget_av->budget.i2c_adap,
>  				   DVB_PLL_PHILIPS_SD1878_TDA8261);
> -		}
>  		break;
> 
>  	case SUBID_DVBS_TYPHOON:
>  		fe = dvb_attach(stv0299_attach, &typhoon_config,
>  				    &budget_av->budget.i2c_adap);
> -		if (fe) {
> +		if (fe)
>  			fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
> -		}
>  		break;
>  	case SUBID_DVBS2_KNC1:
>  	case SUBID_DVBS2_KNC1_OEM:
> @@ -1282,9 +1276,8 @@ static void frontend_init(struct budget_av *budget_av)
>  	case SUBID_DVBS_CINERGY1200:
>  		fe = dvb_attach(stv0299_attach, &cinergy_1200s_config,
>  				    &budget_av->budget.i2c_adap);
> -		if (fe) {
> +		if (fe)
>  			fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
> -		}
>  		break;
> 
>  	case SUBID_DVBC_KNC1:
> @@ -1300,9 +1293,8 @@ static void frontend_init(struct budget_av *budget_av)
>  			fe = dvb_attach(tda10021_attach, &philips_cu1216_config_altaddress,
>  					     &budget_av->budget.i2c_adap,
>  					     read_pwm(budget_av));
> -		if (fe) {
> +		if (fe)
>  			fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params;
> -		}
>  		break;
> 
>  	case SUBID_DVBC_EASYWATCH_MK3:
> @@ -1316,9 +1308,8 @@ static void frontend_init(struct budget_av *budget_av)
>  			&philips_cu1216_tda10023_config,
>  			&budget_av->budget.i2c_adap,
>  			read_pwm(budget_av));
> -		if (fe) {
> +		if (fe)
>  			fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params;
> -		}
>  		break;
> 
>  	case SUBID_DVBT_EASYWATCH:
> diff --git a/drivers/media/pci/ttpci/budget-ci.c b/drivers/media/pci/ttpci/budget-ci.c
> index ebf340417..047b1f07e 100644
> --- a/drivers/media/pci/ttpci/budget-ci.c
> +++ b/drivers/media/pci/ttpci/budget-ci.c
> @@ -412,24 +412,20 @@ static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open
>  	flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0);
>  	if (flags & CICONTROL_CAMDETECT) {
>  		// mark it as present if it wasn't before
> -		if (budget_ci->slot_status & SLOTSTATUS_NONE) {
> +		if (budget_ci->slot_status & SLOTSTATUS_NONE)
>  			budget_ci->slot_status = SLOTSTATUS_PRESENT;
> -		}
> 
>  		// during a RESET, we check if we can read from IO memory to see when CAM is ready
>  		if (budget_ci->slot_status & SLOTSTATUS_RESET) {
> -			if (ciintf_read_attribute_mem(ca, slot, 0) == 0x1d) {
> +			if (ciintf_read_attribute_mem(ca, slot, 0) == 0x1d)
>  				budget_ci->slot_status = SLOTSTATUS_READY;
> -			}
>  		}
> -	} else {
> +	} else
>  		budget_ci->slot_status = SLOTSTATUS_NONE;
> -	}
> 
>  	if (budget_ci->slot_status != SLOTSTATUS_NONE) {
> -		if (budget_ci->slot_status & SLOTSTATUS_READY) {
> +		if (budget_ci->slot_status & SLOTSTATUS_READY)
>  			return DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY;
> -		}
>  		return DVB_CA_EN50221_POLL_CAM_PRESENT;
>  	}
> 
> @@ -494,11 +490,10 @@ static int ciintf_init(struct budget_ci *budget_ci)
>  	// Setup CI slot IRQ
>  	if (budget_ci->ci_irq) {
>  		tasklet_setup(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt);
> -		if (budget_ci->slot_status != SLOTSTATUS_NONE) {
> +		if (budget_ci->slot_status != SLOTSTATUS_NONE)
>  			saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO);
> -		} else {
> +		else
>  			saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI);
> -		}
>  		SAA7146_IER_ENABLE(saa, MASK_03);
>  	}
> 
> diff --git a/drivers/media/pci/ttpci/budget.c b/drivers/media/pci/ttpci/budget.c
> index 9fe087add..79b34c909 100644
> --- a/drivers/media/pci/ttpci/budget.c
> +++ b/drivers/media/pci/ttpci/budget.c
> @@ -229,8 +229,7 @@ static int alps_bsrv2_tuner_set_params(struct dvb_frontend *fe)
>  	return 0;
>  }
> 
> -static struct ves1x93_config alps_bsrv2_config =
> -{
> +static struct ves1x93_config alps_bsrv2_config = {
>  	.demod_address = 0x08,
>  	.xin = 90100000UL,
>  	.invert_pwm = 0,
> @@ -678,8 +677,7 @@ static void frontend_init(struct budget *budget)
>  					tt1600_stv090x_config.tuner_set_refclk	  = ctl->tuner_set_refclk;
>  					tt1600_stv090x_config.tuner_get_status	  = ctl->tuner_get_status;
> 
> -					/*
> -					 * call the init function once to initialize
> +					/* call the init function once to initialize
>  					 * tuner's clock output divider and demod's
>  					 * master clock
>  					 */

This change is unrelated to braces, and also the original looks fine to me.

Is this a mistake?

Regards,

	Hans

> @@ -786,9 +784,8 @@ static int budget_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d
>  	int err;
> 
>  	budget = kmalloc(sizeof(struct budget), GFP_KERNEL);
> -	if (NULL == budget) {
> +	if (NULL == budget)
>  		return -ENOMEM;
> -	}
> 
>  	dprintk(2, "dev:%p, info:%p, budget:%p\n", dev, info, budget);
> 
> --
> 2.34.0
> 
>
diff mbox series

Patch

diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c
index dbd4ef40e..2faea2861 100644
--- a/drivers/media/pci/ttpci/budget-av.c
+++ b/drivers/media/pci/ttpci/budget-av.c
@@ -309,16 +309,14 @@  static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open
 	/* read from attribute memory in reset/ready state to know when the CAM is ready */
 	if (budget_av->slot_status == SLOTSTATUS_RESET) {
 		result = ciintf_read_attribute_mem(ca, slot, 0);
-		if (result == 0x1d) {
+		if (result == 0x1d)
 			budget_av->slot_status = SLOTSTATUS_READY;
-		}
 	}

 	/* work out correct return code */
 	if (budget_av->slot_status != SLOTSTATUS_NONE) {
-		if (budget_av->slot_status & SLOTSTATUS_READY) {
+		if (budget_av->slot_status & SLOTSTATUS_READY)
 			return DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY;
-		}
 		return DVB_CA_EN50221_POLL_CAM_PRESENT;
 	}
 	return 0;
@@ -1237,15 +1235,13 @@  static void frontend_init(struct budget_av *budget_av)
 		if (saa->pci->subsystem_vendor == 0x1894) {
 			fe = dvb_attach(stv0299_attach, &cinergy_1200s_1894_0010_config,
 					     &budget_av->budget.i2c_adap);
-			if (fe) {
+			if (fe)
 				dvb_attach(tua6100_attach, fe, 0x60, &budget_av->budget.i2c_adap);
-			}
 		} else {
 			fe = dvb_attach(stv0299_attach, &typhoon_config,
 					     &budget_av->budget.i2c_adap);
-			if (fe) {
+			if (fe)
 				fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
-			}
 		}
 		break;

@@ -1257,19 +1253,17 @@  static void frontend_init(struct budget_av *budget_av)
 	case SUBID_DVBS_EASYWATCH_2:
 		fe = dvb_attach(stv0299_attach, &philips_sd1878_config,
 				&budget_av->budget.i2c_adap);
-		if (fe) {
+		if (fe)
 			dvb_attach(dvb_pll_attach, fe, 0x60,
 				   &budget_av->budget.i2c_adap,
 				   DVB_PLL_PHILIPS_SD1878_TDA8261);
-		}
 		break;

 	case SUBID_DVBS_TYPHOON:
 		fe = dvb_attach(stv0299_attach, &typhoon_config,
 				    &budget_av->budget.i2c_adap);
-		if (fe) {
+		if (fe)
 			fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
-		}
 		break;
 	case SUBID_DVBS2_KNC1:
 	case SUBID_DVBS2_KNC1_OEM:
@@ -1282,9 +1276,8 @@  static void frontend_init(struct budget_av *budget_av)
 	case SUBID_DVBS_CINERGY1200:
 		fe = dvb_attach(stv0299_attach, &cinergy_1200s_config,
 				    &budget_av->budget.i2c_adap);
-		if (fe) {
+		if (fe)
 			fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
-		}
 		break;

 	case SUBID_DVBC_KNC1:
@@ -1300,9 +1293,8 @@  static void frontend_init(struct budget_av *budget_av)
 			fe = dvb_attach(tda10021_attach, &philips_cu1216_config_altaddress,
 					     &budget_av->budget.i2c_adap,
 					     read_pwm(budget_av));
-		if (fe) {
+		if (fe)
 			fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params;
-		}
 		break;

 	case SUBID_DVBC_EASYWATCH_MK3:
@@ -1316,9 +1308,8 @@  static void frontend_init(struct budget_av *budget_av)
 			&philips_cu1216_tda10023_config,
 			&budget_av->budget.i2c_adap,
 			read_pwm(budget_av));
-		if (fe) {
+		if (fe)
 			fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params;
-		}
 		break;

 	case SUBID_DVBT_EASYWATCH:
diff --git a/drivers/media/pci/ttpci/budget-ci.c b/drivers/media/pci/ttpci/budget-ci.c
index ebf340417..047b1f07e 100644
--- a/drivers/media/pci/ttpci/budget-ci.c
+++ b/drivers/media/pci/ttpci/budget-ci.c
@@ -412,24 +412,20 @@  static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open
 	flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0);
 	if (flags & CICONTROL_CAMDETECT) {
 		// mark it as present if it wasn't before
-		if (budget_ci->slot_status & SLOTSTATUS_NONE) {
+		if (budget_ci->slot_status & SLOTSTATUS_NONE)
 			budget_ci->slot_status = SLOTSTATUS_PRESENT;
-		}

 		// during a RESET, we check if we can read from IO memory to see when CAM is ready
 		if (budget_ci->slot_status & SLOTSTATUS_RESET) {
-			if (ciintf_read_attribute_mem(ca, slot, 0) == 0x1d) {
+			if (ciintf_read_attribute_mem(ca, slot, 0) == 0x1d)
 				budget_ci->slot_status = SLOTSTATUS_READY;
-			}
 		}
-	} else {
+	} else
 		budget_ci->slot_status = SLOTSTATUS_NONE;
-	}

 	if (budget_ci->slot_status != SLOTSTATUS_NONE) {
-		if (budget_ci->slot_status & SLOTSTATUS_READY) {
+		if (budget_ci->slot_status & SLOTSTATUS_READY)
 			return DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY;
-		}
 		return DVB_CA_EN50221_POLL_CAM_PRESENT;
 	}

@@ -494,11 +490,10 @@  static int ciintf_init(struct budget_ci *budget_ci)
 	// Setup CI slot IRQ
 	if (budget_ci->ci_irq) {
 		tasklet_setup(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt);
-		if (budget_ci->slot_status != SLOTSTATUS_NONE) {
+		if (budget_ci->slot_status != SLOTSTATUS_NONE)
 			saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO);
-		} else {
+		else
 			saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI);
-		}
 		SAA7146_IER_ENABLE(saa, MASK_03);
 	}

diff --git a/drivers/media/pci/ttpci/budget.c b/drivers/media/pci/ttpci/budget.c
index 9fe087add..79b34c909 100644
--- a/drivers/media/pci/ttpci/budget.c
+++ b/drivers/media/pci/ttpci/budget.c
@@ -229,8 +229,7 @@  static int alps_bsrv2_tuner_set_params(struct dvb_frontend *fe)
 	return 0;
 }

-static struct ves1x93_config alps_bsrv2_config =
-{
+static struct ves1x93_config alps_bsrv2_config = {
 	.demod_address = 0x08,
 	.xin = 90100000UL,
 	.invert_pwm = 0,
@@ -678,8 +677,7 @@  static void frontend_init(struct budget *budget)
 					tt1600_stv090x_config.tuner_set_refclk	  = ctl->tuner_set_refclk;
 					tt1600_stv090x_config.tuner_get_status	  = ctl->tuner_get_status;

-					/*
-					 * call the init function once to initialize
+					/* call the init function once to initialize
 					 * tuner's clock output divider and demod's
 					 * master clock
 					 */
@@ -786,9 +784,8 @@  static int budget_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d
 	int err;

 	budget = kmalloc(sizeof(struct budget), GFP_KERNEL);
-	if (NULL == budget) {
+	if (NULL == budget)
 		return -ENOMEM;
-	}

 	dprintk(2, "dev:%p, info:%p, budget:%p\n", dev, info, budget);