]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
media: av7110: coding style fixes: comparsations
authorStefan Herdler <herdler@nurfuerspam.de>
Tue, 7 May 2024 00:24:54 +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:

WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written ...

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_hw.c
drivers/staging/media/av7110/av7110_v4l.c

index fac774dc6eab720bcb5edf65d988c4aba942a27d..de947615407523fccc5b1808ea308697426e6743 100644 (file)
@@ -104,7 +104,7 @@ static int av7110_num;
 
 #define FE_FUNC_OVERRIDE(fe_func, av7110_copy, av7110_func) \
 {\
-       if (fe_func != NULL) { \
+       if (fe_func) { \
                av7110_copy = fe_func; \
                fe_func = av7110_func; \
        } \
@@ -159,7 +159,7 @@ static void init_av7110_av(struct av7110 *av7110)
                /**
                 * some special handling for the Siemens DVB-C cards...
                 */
-       } else if (0 == av7110_init_analog_module(av7110)) {
+       } else if (av7110_init_analog_module(av7110) == 0) {
                /* done. */
        } else if (dev->pci->subsystem_vendor == 0x110a) {
                printk("dvb-ttpci: DVB-C w/o analog module @ card %d detected\n",
@@ -1386,7 +1386,7 @@ static void dvb_unregister(struct av7110 *av7110)
        dvb_dmxdev_release(&av7110->dmxdev);
        dvb_dmx_release(&av7110->demux);
 
-       if (av7110->fe != NULL) {
+       if (av7110->fe) {
                dvb_unregister_frontend(av7110->fe);
                dvb_frontend_detach(av7110->fe);
        }
@@ -1518,7 +1518,7 @@ static int get_firmware(struct av7110 *av7110)
 
        /* check if the firmware is available */
        av7110->bin_fw = vmalloc(fw->size);
-       if (NULL == av7110->bin_fw) {
+       if (!av7110->bin_fw) {
                dprintk(1, "out of memory\n");
                release_firmware(fw);
                return -ENOMEM;
@@ -2233,7 +2233,7 @@ static int frontend_init(struct av7110 *av7110)
                                av7110->fe->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params;
                                av7110->fe->tuner_priv = &av7110->i2c_adap;
 
-                               if (dvb_attach(lnbp21_attach, av7110->fe, &av7110->i2c_adap, 0, 0) == NULL) {
+                               if (!dvb_attach(lnbp21_attach, av7110->fe, &av7110->i2c_adap, 0, 0)) {
                                        printk("dvb-ttpci: LNBP21 not found!\n");
                                        if (av7110->fe->ops.release)
                                                av7110->fe->ops.release(av7110->fe);
index 52290a50074dc617e79ccc3cfed70189e49ec889..5a4de3e3e9678f03926620f810be26a026e352df 100644 (file)
@@ -390,7 +390,7 @@ static int __av7110_send_fw_cmd(struct av7110 *av7110, u16 *buf, int length)
                break;
        }
 
-       if (type != NULL) {
+       if (type) {
                /* non-immediate COMMAND type */
                start = jiffies;
                for (;;) {
index f19e505370dd755ecc6860e238a899736fd8ad3c..0ccc34f3d19c0f6a8518d70b39937c48dc740b27 100644 (file)
@@ -128,7 +128,7 @@ static int ves1820_writereg(struct saa7146_dev *dev, u8 addr, u8 reg, u8 data)
 
        dprintk(4, "dev: %p\n", dev);
 
-       if (1 != i2c_transfer(&av7110->i2c_adap, &msg, 1))
+       if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1)
                return -1;
        return 0;
 }
@@ -140,7 +140,7 @@ static int tuner_write(struct saa7146_dev *dev, u8 addr, u8 data[4])
 
        dprintk(4, "dev: %p\n", dev);
 
-       if (1 != i2c_transfer(&av7110->i2c_adap, &msg, 1))
+       if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1)
                return -1;
        return 0;
 }
@@ -221,7 +221,7 @@ static int av7110_dvb_c_switch(struct saa7146_dev *dev)
 
        dprintk(4, "%p\n", av7110);
 
-       if (0 != av7110->current_input) {
+       if (av7110->current_input != 0) {
                dprintk(1, "switching to analog TV:\n");
                adswitch = 1;
                source = SAA7146_HPS_SOURCE_PORT_B;
@@ -409,7 +409,7 @@ static int vidioc_s_frequency(struct file *file, void *fh, const struct v4l2_fre
        if (!av7110->analog_tuner_flags || av7110->current_input != 1)
                return -EINVAL;
 
-       if (V4L2_TUNER_ANALOG_TV != f->type)
+       if (f->type != V4L2_TUNER_ANALOG_TV)
                return -EINVAL;
 
        msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0xffe0); /* fast mute */