diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2015-06-10 03:40:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-11-18 09:21:29 -0500 |
commit | 4bdbcb3197fb1d6c493e2fe50b54bc91c6999924 (patch) | |
tree | 327a926e5843f1361c33ddccbec5ac09232d4888 | |
parent | 217bdb0741ff4f2db8a1d52b967101702e8694c1 (diff) |
[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>
-rw-r--r-- | drivers/media/pci/ddbridge/ddbridge-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 0ac2dd35fe50..fba5b40a869c 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c | |||
@@ -81,13 +81,13 @@ static int i2c_read_reg16(struct i2c_adapter *adapter, u8 adr, | |||
81 | static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd) | 81 | static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd) |
82 | { | 82 | { |
83 | struct ddb *dev = i2c->dev; | 83 | struct ddb *dev = i2c->dev; |
84 | int stat; | 84 | long stat; |
85 | u32 val; | 85 | u32 val; |
86 | 86 | ||
87 | i2c->done = 0; | 87 | i2c->done = 0; |
88 | ddbwritel((adr << 9) | cmd, i2c->regs + I2C_COMMAND); | 88 | ddbwritel((adr << 9) | cmd, i2c->regs + I2C_COMMAND); |
89 | stat = wait_event_timeout(i2c->wq, i2c->done == 1, HZ); | 89 | stat = wait_event_timeout(i2c->wq, i2c->done == 1, HZ); |
90 | if (stat <= 0) { | 90 | if (stat == 0) { |
91 | printk(KERN_ERR "I2C timeout\n"); | 91 | printk(KERN_ERR "I2C timeout\n"); |
92 | { /* MSI debugging*/ | 92 | { /* MSI debugging*/ |
93 | u32 istat = ddbreadl(INTERRUPT_STATUS); | 93 | u32 istat = ddbreadl(INTERRUPT_STATUS); |