media: av7110: coding style fixes: braces
authorStefan Herdler <herdler@nurfuerspam.de>
Tue, 7 May 2024 00:24:52 +0000 (02:24 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 4 Jun 2024 14:19:56 +0000 (16:19 +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
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/staging/media/av7110/av7110.c
drivers/staging/media/av7110/av7110_av.c
drivers/staging/media/av7110/av7110_hw.c
drivers/staging/media/av7110/av7110_ipack.c
drivers/staging/media/av7110/av7110_v4l.c
drivers/staging/media/av7110/dvb_filter.c

index 49735cbb2ea4f8fd7810b76091d69c72e2fef66e..78d708ffc8f327e1ceae96b8abe8e110710970de 100644 (file)
@@ -408,10 +408,11 @@ static void debiirq(struct tasklet_struct *t)
                        if (data[5] > 5)
                                flags |= CA_CI_MODULE_READY;
                        av7110->ci_slot[data_0].flags = flags;
-               } else
+               } else {
                        ci_get_data(&av7110->ci_rbuffer,
                                    av7110->debi_virt,
                                    av7110->debilen);
+               }
                xfer = RX_BUFF;
                break;
        }
@@ -1010,10 +1011,9 @@ static int av7110_stop_feed(struct dvb_demux_feed *feed)
                        demux->pids[feed->pes_type] |= 0x8000;
                        demux->pesfilter[feed->pes_type] = NULL;
                }
-               if (feed->ts_type & TS_DECODER &&
-                   feed->pes_type < DMX_PES_OTHER) {
+               if (feed->ts_type & TS_DECODER && feed->pes_type < DMX_PES_OTHER)
                        ret = dvb_feed_stop_pid(feed);
-               else
+               else
                        if ((feed->ts_type & TS_PACKET) &&
                            (demux->dmx.frontend->source != DMX_MEMORY_FE))
                                ret = StopHWFilter(feed->filter);
@@ -1245,10 +1245,10 @@ static void vpeirq(struct tasklet_struct *t)
               saa7146_read(budget->dev, EC1R) & 0x3fff);
 #endif
 
-       if (newdma > olddma)
+       if (newdma > olddma) {
                /* no wraparound, dump olddma..newdma */
                dvb_dmx_swfilter_packets(demux, mem + olddma, (newdma - olddma) / 188);
-       else {
+       else {
                /* wraparound, dump olddma..buflen and 0..newdma */
                dvb_dmx_swfilter_packets(demux, mem + olddma, (TS_BUFLEN - olddma) / 188);
                dvb_dmx_swfilter_packets(demux, mem, newdma / 188);
@@ -1488,9 +1488,10 @@ static int get_firmware(struct av7110 *av7110)
                        printk(KERN_ERR "dvb-ttpci: could not load firmware, file not found: dvb-ttpci-01.fw\n");
                        printk(KERN_ERR "dvb-ttpci: usually this should be in /usr/lib/hotplug/firmware or /lib/firmware\n");
                        printk(KERN_ERR "dvb-ttpci: and can be downloaded from https://linuxtv.org/download/dvb/firmware/\n");
-               } else
+               } else {
                        printk(KERN_ERR "dvb-ttpci: cannot request firmware (error %i)\n",
                               ret);
+               }
                return -EINVAL;
        }
 
@@ -2076,9 +2077,8 @@ static int frontend_init(struct av7110 *av7110)
                case 0x0000: // Fujitsu/Siemens DVB-Cable (ves1820/Philips CD1516(??))
                        av7110->fe = dvb_attach(ves1820_attach, &philips_cd1516_config,
                                                &av7110->i2c_adap, read_pwm(av7110));
-                       if (av7110->fe) {
+                       if (av7110->fe)
                                av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params;
-                       }
                        break;
                }
 
@@ -2129,17 +2129,15 @@ static int frontend_init(struct av7110 *av7110)
                                /* Siemens DVB-C (full-length card) VES1820/Philips CD1516 */
                                av7110->fe = dvb_attach(ves1820_attach, &philips_cd1516_config, &av7110->i2c_adap,
                                                        read_pwm(av7110));
-                               if (av7110->fe) {
+                               if (av7110->fe)
                                        av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params;
-                               }
                                break;
                        case 0x0003:
                                /* Hauppauge DVB-C 2.1 VES1820/ALPS TDBE2 */
                                av7110->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &av7110->i2c_adap,
                                                        read_pwm(av7110));
-                               if (av7110->fe) {
+                               if (av7110->fe)
                                        av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params;
-                               }
                                break;
                        }
                        break;
@@ -2168,9 +2166,8 @@ static int frontend_init(struct av7110 *av7110)
                case 0x0002: // Hauppauge/TT DVB-C premium rev2.X
 
                        av7110->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110));
-                       if (av7110->fe) {
+                       if (av7110->fe)
                                av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params;
-                       }
                        break;
 
                case 0x0004: // Galaxis DVB-S rev1.3
index f5200aa3dd17888ad9b1f9388ffc3d2393dd51f8..35af0cd6dd55187d00b2a4e2cea648a2a35cbd18 100644 (file)
@@ -412,8 +412,9 @@ static void play_video_cb(u8 *buf, int count, void *priv)
        if ((buf[3] & 0xe0) == 0xe0) {
                get_video_format(av7110, buf, count);
                aux_ring_buffer_write(&av7110->avout, buf, count);
-       } else
+       } else {
                aux_ring_buffer_write(&av7110->aout, buf, count);
+       }
 }
 
 static void play_audio_cb(u8 *buf, int count, void *priv)
@@ -610,8 +611,9 @@ static int find_pes_header(u8 const *buf, long int length, int *frags)
                                c++;
                                break;
                        }
-               } else
+               } else {
                        c++;
+               }
        }
        if (c == length - 3 && !found) {
                if (buf[length - 1] == 0x00)
@@ -709,8 +711,9 @@ void av7110_p2t_write(u8 const *buf, long int length, u16 pid, struct av7110_p2t
                                c = c2;
                                clear_p2t(p);
                                add = 0;
-                       } else
+                       } else {
                                add = 1;
+                       }
                } else {
                        l = length - c;
                        rest = l % (TS_SIZE - 4);
@@ -981,8 +984,10 @@ static __poll_t dvb_audio_poll(struct file *file, poll_table *wait)
        if (av7110->playing) {
                if (dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024)
                        mask |= (EPOLLOUT | EPOLLWRNORM);
-       } else /* if not playing: may play if asked for */
+       } else {
+               /* if not playing: may play if asked for */
                mask = (EPOLLOUT | EPOLLWRNORM);
+       }
 
        return mask;
 }
@@ -1532,9 +1537,8 @@ static int dvb_video_release(struct inode *inode, struct file *file)
 
        dprintk(2, "av7110:%p, \n", av7110);
 
-       if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
+       if ((file->f_flags & O_ACCMODE) != O_RDONLY)
                av7110_av_stop(av7110, RP_VIDEO);
-       }
 
        return dvb_generic_release(inode, file);
 }
index c7ea72128899cc70b2a791c81e772522d9163257..d775dd632d5b8f0d968232fe6ba5a8cbca4e1a56 100644 (file)
@@ -1076,9 +1076,9 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
                ret = OSDSetColor(av7110, dc->color, dc->x0, dc->y0, dc->x1, dc->y1);
                break;
        case OSD_SetPalette:
-               if (FW_VERSION(av7110->arm_app) >= 0x2618)
+               if (FW_VERSION(av7110->arm_app) >= 0x2618) {
                        ret = OSDSetPalette(av7110, dc->data, dc->color, dc->x0);
-               else {
+               else {
                        int i, len = dc->x0 - dc->color + 1;
                        u8 __user *colors = (u8 __user *)dc->data;
                        u8 r, g = 0, b = 0, blend = 0;
@@ -1140,9 +1140,9 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
                break;
        }
        case OSD_SetWindow:
-               if (dc->x0 < 1 || dc->x0 > 7)
+               if (dc->x0 < 1 || dc->x0 > 7) {
                        ret = -EINVAL;
-               else {
+               else {
                        av7110->osdwin = dc->x0;
                        ret = 0;
                }
index 9fe18f4707f5c874f8674a2ea08025bba9abf67e..c18a9f586db123e72dd71fae8b8586f74cb83923 100644 (file)
@@ -215,9 +215,9 @@ int av7110_ipack_instant_repack(const u8 *buf, int count, struct ipack *p)
                                p->flag1 = buf[c];
                                c++;
                                p->found++;
-                               if ((p->flag1 & 0xc0) == 0x80)
+                               if ((p->flag1 & 0xc0) == 0x80) {
                                        p->mpeg = 2;
-                               else {
+                               else {
                                        p->hlength = 0;
                                        p->which = 0;
                                        p->mpeg = 1;
index 633dbb697943dc27346fb09398ca69dc1f2ab658..f19e505370dd755ecc6860e238a899736fd8ad3c 100644 (file)
@@ -330,8 +330,10 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
                /* bilingual */
                t->rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
                t->audmode = V4L2_TUNER_MODE_LANG1;
-       } else /* mono */
+       } else {
+               /* mono */
                t->rxsubchans = V4L2_TUNER_SUB_MONO;
+       }
 
        return 0;
 }
@@ -709,8 +711,9 @@ int av7110_init_analog_module(struct av7110 *av7110)
                pr_info("DVB-C analog module @ card %d detected, initializing MSP3415\n",
                        av7110->dvb_adapter.num);
                av7110->adac_type = DVB_ADAC_MSP34x5;
-       } else
+       } else {
                return -ENODEV;
+       }
 
        msleep(100); // the probing above resets the msp...
        msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1);
@@ -922,9 +925,9 @@ static int std_callback(struct saa7146_dev *dev, struct saa7146_standard *std)
        } else if (std->id & V4L2_STD_NTSC) {
                av7110->vidmode = AV7110_VIDEO_MODE_NTSC;
                av7110_set_vidmode(av7110, av7110->vidmode);
-       }
-       else
+       } else {
                return -1;
+       }
 
        return 0;
 }
index 515b4288b21303ef2f37dcc8fefd9cd582fa0aee..f92faae446ac493cc4cbb5a3fdb8a2b12cd8a86a 100644 (file)
@@ -33,9 +33,8 @@ int dvb_filter_get_ac3info(u8 *mbuf, int count, struct dvb_audio_info *ai, int p
 
                if (b[0] == 0x0b &&  b[1] == 0x77)
                        found = 1;
-               else {
+               else
                        c++;
-               }
        }
 
        if (!found)