Skip to content

Commit 529b76b

Browse files
Stefan Herdleropsiff
authored andcommitted
media: av7110: coding style fixes: comparsations
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> (cherry picked from commit 3c08dc3) Stable-dep-of: 458ea1c ("media: av7110: fix a spectre vulnerability") Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 43ceaec commit 529b76b

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

drivers/staging/media/av7110/av7110.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static int av7110_num;
104104

105105
#define FE_FUNC_OVERRIDE(fe_func, av7110_copy, av7110_func) \
106106
{\
107-
if (fe_func != NULL) { \
107+
if (fe_func) { \
108108
av7110_copy = fe_func; \
109109
fe_func = av7110_func; \
110110
} \
@@ -159,7 +159,7 @@ static void init_av7110_av(struct av7110 *av7110)
159159
/**
160160
* some special handling for the Siemens DVB-C cards...
161161
*/
162-
} else if (0 == av7110_init_analog_module(av7110)) {
162+
} else if (av7110_init_analog_module(av7110) == 0) {
163163
/* done. */
164164
} else if (dev->pci->subsystem_vendor == 0x110a) {
165165
printk("dvb-ttpci: DVB-C w/o analog module @ card %d detected\n",
@@ -1386,7 +1386,7 @@ static void dvb_unregister(struct av7110 *av7110)
13861386
dvb_dmxdev_release(&av7110->dmxdev);
13871387
dvb_dmx_release(&av7110->demux);
13881388

1389-
if (av7110->fe != NULL) {
1389+
if (av7110->fe) {
13901390
dvb_unregister_frontend(av7110->fe);
13911391
dvb_frontend_detach(av7110->fe);
13921392
}
@@ -1518,7 +1518,7 @@ static int get_firmware(struct av7110 *av7110)
15181518

15191519
/* check if the firmware is available */
15201520
av7110->bin_fw = vmalloc(fw->size);
1521-
if (NULL == av7110->bin_fw) {
1521+
if (!av7110->bin_fw) {
15221522
dprintk(1, "out of memory\n");
15231523
release_firmware(fw);
15241524
return -ENOMEM;
@@ -2233,7 +2233,7 @@ static int frontend_init(struct av7110 *av7110)
22332233
av7110->fe->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params;
22342234
av7110->fe->tuner_priv = &av7110->i2c_adap;
22352235

2236-
if (dvb_attach(lnbp21_attach, av7110->fe, &av7110->i2c_adap, 0, 0) == NULL) {
2236+
if (!dvb_attach(lnbp21_attach, av7110->fe, &av7110->i2c_adap, 0, 0)) {
22372237
printk("dvb-ttpci: LNBP21 not found!\n");
22382238
if (av7110->fe->ops.release)
22392239
av7110->fe->ops.release(av7110->fe);

drivers/staging/media/av7110/av7110_hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static int __av7110_send_fw_cmd(struct av7110 *av7110, u16 *buf, int length)
390390
break;
391391
}
392392

393-
if (type != NULL) {
393+
if (type) {
394394
/* non-immediate COMMAND type */
395395
start = jiffies;
396396
for (;;) {

drivers/staging/media/av7110/av7110_v4l.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static int ves1820_writereg(struct saa7146_dev *dev, u8 addr, u8 reg, u8 data)
128128

129129
dprintk(4, "dev: %p\n", dev);
130130

131-
if (1 != i2c_transfer(&av7110->i2c_adap, &msg, 1))
131+
if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1)
132132
return -1;
133133
return 0;
134134
}
@@ -140,7 +140,7 @@ static int tuner_write(struct saa7146_dev *dev, u8 addr, u8 data[4])
140140

141141
dprintk(4, "dev: %p\n", dev);
142142

143-
if (1 != i2c_transfer(&av7110->i2c_adap, &msg, 1))
143+
if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1)
144144
return -1;
145145
return 0;
146146
}
@@ -221,7 +221,7 @@ static int av7110_dvb_c_switch(struct saa7146_dev *dev)
221221

222222
dprintk(4, "%p\n", av7110);
223223

224-
if (0 != av7110->current_input) {
224+
if (av7110->current_input != 0) {
225225
dprintk(1, "switching to analog TV:\n");
226226
adswitch = 1;
227227
source = SAA7146_HPS_SOURCE_PORT_B;
@@ -409,7 +409,7 @@ static int vidioc_s_frequency(struct file *file, void *fh, const struct v4l2_fre
409409
if (!av7110->analog_tuner_flags || av7110->current_input != 1)
410410
return -EINVAL;
411411

412-
if (V4L2_TUNER_ANALOG_TV != f->type)
412+
if (f->type != V4L2_TUNER_ANALOG_TV)
413413
return -EINVAL;
414414

415415
msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0xffe0); /* fast mute */

0 commit comments

Comments
 (0)