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@xxxxxxxxxxxxxx> --- drivers/staging/media/av7110/av7110.c | 10 +++++----- drivers/staging/media/av7110/av7110_hw.c | 2 +- drivers/staging/media/av7110/av7110_v4l.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index fac774dc6..de9476154 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -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); diff --git a/drivers/staging/media/av7110/av7110_hw.c b/drivers/staging/media/av7110/av7110_hw.c index 52290a500..5a4de3e3e 100644 --- a/drivers/staging/media/av7110/av7110_hw.c +++ b/drivers/staging/media/av7110/av7110_hw.c @@ -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 (;;) { diff --git a/drivers/staging/media/av7110/av7110_v4l.c b/drivers/staging/media/av7110/av7110_v4l.c index f19e50537..0ccc34f3d 100644 --- a/drivers/staging/media/av7110/av7110_v4l.c +++ b/drivers/staging/media/av7110/av7110_v4l.c @@ -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 */ -- 2.34.0