Message ID | 1445395021-4204-6-git-send-email-jaedon.shin@gmail.com |
---|---|
State | Rejected |
Headers | show |
On Wed, Oct 21, 2015 at 11:36:57AM +0900, Jaedon Shin wrote: > Fixes conditions for RESTART, NOSTART and NOSTOP. The masks of start and > stop is already in brcmstb_set_i2c_start_stop(). Therefore, the caller > does not need a mask value. Hmm, and what if that changes for some reason in the future (driver refactoring)? I'd rather leave it as it is; it is a micro-optimization after all. > > Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com> > --- > drivers/i2c/busses/i2c-brcmstb.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c > index 53eb8b0c9bad..dcd1209f843f 100644 > --- a/drivers/i2c/busses/i2c-brcmstb.c > +++ b/drivers/i2c/busses/i2c-brcmstb.c > @@ -464,7 +464,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, > pmsg->buf ? pmsg->buf[0] : '0', pmsg->len); > > if (i < (num - 1) && (msgs[i + 1].flags & I2C_M_NOSTART)) > - brcmstb_set_i2c_start_stop(dev, ~(COND_START_STOP)); > + brcmstb_set_i2c_start_stop(dev, 0); > else > brcmstb_set_i2c_start_stop(dev, > COND_RESTART | COND_NOSTOP); > @@ -485,8 +485,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, > bytes_to_xfer = min(len, N_DATA_BYTES); > > if (len <= N_DATA_BYTES && i == (num - 1)) > - brcmstb_set_i2c_start_stop(dev, > - ~(COND_START_STOP)); > + brcmstb_set_i2c_start_stop(dev, 0); > > rc = brcmstb_i2c_xfer_bsc_data(dev, tmp_buf, > bytes_to_xfer, pmsg); > -- > 2.6.1 >
diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c index 53eb8b0c9bad..dcd1209f843f 100644 --- a/drivers/i2c/busses/i2c-brcmstb.c +++ b/drivers/i2c/busses/i2c-brcmstb.c @@ -464,7 +464,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, pmsg->buf ? pmsg->buf[0] : '0', pmsg->len); if (i < (num - 1) && (msgs[i + 1].flags & I2C_M_NOSTART)) - brcmstb_set_i2c_start_stop(dev, ~(COND_START_STOP)); + brcmstb_set_i2c_start_stop(dev, 0); else brcmstb_set_i2c_start_stop(dev, COND_RESTART | COND_NOSTOP); @@ -485,8 +485,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, bytes_to_xfer = min(len, N_DATA_BYTES); if (len <= N_DATA_BYTES && i == (num - 1)) - brcmstb_set_i2c_start_stop(dev, - ~(COND_START_STOP)); + brcmstb_set_i2c_start_stop(dev, 0); rc = brcmstb_i2c_xfer_bsc_data(dev, tmp_buf, bytes_to_xfer, pmsg);
Fixes conditions for RESTART, NOSTART and NOSTOP. The masks of start and stop is already in brcmstb_set_i2c_start_stop(). Therefore, the caller does not need a mask value. Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com> --- drivers/i2c/busses/i2c-brcmstb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)