瀏覽代碼

[media] ddbridge: fix wait_event_timeout return handling

API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/media/pci/ddbridge/ddbridge-core.c:89
        incorrect check for negative return

Return type of wait_event_timeout is signed long not int and the
return type is >=0 always thus the negative check is unnecessary..
As stat is used here exclusively its type is simply changed and the
negative return check dropped.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Nicholas Mc Guire 10 年之前
父節點
當前提交
4bdbcb3197
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/media/pci/ddbridge/ddbridge-core.c

+ 2 - 2
drivers/media/pci/ddbridge/ddbridge-core.c

@@ -81,13 +81,13 @@ static int i2c_read_reg16(struct i2c_adapter *adapter, u8 adr,
 static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)
 static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)
 {
 {
 	struct ddb *dev = i2c->dev;
 	struct ddb *dev = i2c->dev;
-	int stat;
+	long stat;
 	u32 val;
 	u32 val;
 
 
 	i2c->done = 0;
 	i2c->done = 0;
 	ddbwritel((adr << 9) | cmd, i2c->regs + I2C_COMMAND);
 	ddbwritel((adr << 9) | cmd, i2c->regs + I2C_COMMAND);
 	stat = wait_event_timeout(i2c->wq, i2c->done == 1, HZ);
 	stat = wait_event_timeout(i2c->wq, i2c->done == 1, HZ);
-	if (stat <= 0) {
+	if (stat == 0) {
 		printk(KERN_ERR "I2C timeout\n");
 		printk(KERN_ERR "I2C timeout\n");
 		{ /* MSI debugging*/
 		{ /* MSI debugging*/
 			u32 istat = ddbreadl(INTERRUPT_STATUS);
 			u32 istat = ddbreadl(INTERRUPT_STATUS);