]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: ttpci: coding style fixes: braces
authorStefan Herdler <herdler@nurfuerspam.de>
Mon, 15 Apr 2024 02:24:05 +0000 (04:24 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 15 Apr 2024 22:02:53 +0000 (00:02 +0200)
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
CHECK:BRACES: braces {} should be used on all arms of this statement
CHECK:BRACES: Unbalanced braces around else statement

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/pci/ttpci/budget-av.c
drivers/media/pci/ttpci/budget-ci.c
drivers/media/pci/ttpci/budget.c

index dbd4ef40e86780a2026879ea98694e28eb7cbed6..acac9bae4eda7cdab36746ebd710313c8315f959 100644 (file)
@@ -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;
@@ -452,8 +450,9 @@ static int saa7113_setinput(struct budget_av *budget_av, int input)
        } else if (input == 0) {
                i2c_writereg(&budget->i2c_adap, 0x4a, 0x02, 0xc0);
                i2c_writereg(&budget->i2c_adap, 0x4a, 0x09, 0x00);
-       } else
+       } else {
                return -EINVAL;
+       }
 
        budget_av->cur_input = input;
        return 0;
@@ -1237,15 +1236,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 +1254,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 +1277,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 +1294,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 +1309,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:
index ebf340417de0621c6bde70e4425d214b08414893..2a51febdb86117c634b94ea386013d4fc7fcbf4b 100644 (file)
@@ -412,24 +412,21 @@ 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 {
                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 +491,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);
        }
 
@@ -857,9 +853,9 @@ static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe)
 
        // determine charge pump
        tuner_frequency = p->frequency + 36125000;
-       if (tuner_frequency < 87000000)
+       if (tuner_frequency < 87000000) {
                return -EINVAL;
-       else if (tuner_frequency < 130000000) {
+       else if (tuner_frequency < 130000000) {
                cp = 3;
                band = 1;
        } else if (tuner_frequency < 160000000) {
@@ -886,8 +882,9 @@ static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe)
        } else if (tuner_frequency < 895000000) {
                cp = 7;
                band = 4;
-       } else
+       } else {
                return -EINVAL;
+       }
 
        // assume PLL filter should always be 8MHz for the moment.
        filter = 1;
index 9fe087addcc656a97495095d454a153d032f76a9..44f09b5485e69eb6f574db847f4d88d4c4ea70e4 100644 (file)
@@ -100,9 +100,9 @@ static int SendDiSEqCMsg(struct budget *budget, int len, u8 *msg, unsigned long
        mdelay(16);
 
        if (burst != -1) {
-               if (burst)
+               if (burst) {
                        DiseqcSendByte(budget, 0xff);
-               else {
+               else {
                        saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI);
                        mdelay(12);
                        udelay(500);
@@ -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,
@@ -786,9 +785,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);