i2c: robotfuzz-osif: remove pointless local variable
Just use the value directly instead of assigning it to a variable first. And then drop the unused variable. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
17dd94796c
commit
7fb29b958d
@ -63,26 +63,23 @@ static int osif_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
|
|||||||
struct osif_priv *priv = adapter->algo_data;
|
struct osif_priv *priv = adapter->algo_data;
|
||||||
struct i2c_msg *pmsg;
|
struct i2c_msg *pmsg;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int i, cmd;
|
int i;
|
||||||
|
|
||||||
for (i = 0; ret >= 0 && i < num; i++) {
|
for (i = 0; ret >= 0 && i < num; i++) {
|
||||||
pmsg = &msgs[i];
|
pmsg = &msgs[i];
|
||||||
|
|
||||||
if (pmsg->flags & I2C_M_RD) {
|
if (pmsg->flags & I2C_M_RD) {
|
||||||
cmd = OSIFI2C_READ;
|
ret = osif_usb_read(adapter, OSIFI2C_READ,
|
||||||
|
pmsg->flags, pmsg->addr,
|
||||||
ret = osif_usb_read(adapter, cmd, pmsg->flags,
|
pmsg->buf, pmsg->len);
|
||||||
pmsg->addr, pmsg->buf,
|
|
||||||
pmsg->len);
|
|
||||||
if (ret != pmsg->len) {
|
if (ret != pmsg->len) {
|
||||||
dev_err(&adapter->dev, "failure reading data\n");
|
dev_err(&adapter->dev, "failure reading data\n");
|
||||||
return -EREMOTEIO;
|
return -EREMOTEIO;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cmd = OSIFI2C_WRITE;
|
ret = osif_usb_write(adapter, OSIFI2C_WRITE,
|
||||||
|
pmsg->flags, pmsg->addr,
|
||||||
ret = osif_usb_write(adapter, cmd, pmsg->flags,
|
pmsg->buf, pmsg->len);
|
||||||
pmsg->addr, pmsg->buf, pmsg->len);
|
|
||||||
if (ret != pmsg->len) {
|
if (ret != pmsg->len) {
|
||||||
dev_err(&adapter->dev, "failure writing data\n");
|
dev_err(&adapter->dev, "failure writing data\n");
|
||||||
return -EREMOTEIO;
|
return -EREMOTEIO;
|
||||||
|
Loading…
Reference in New Issue
Block a user