From: Dan Carpenter Date: Thu, 29 Sep 2011 05:09:42 +0000 (-0300) Subject: [media] mxl111sf: fix a couple precedence bugs X-Git-Tag: MMI-PSA29.97-13-9~18177^2~52 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4c4364e022f8422e602edbb97a2d873dc0b6c769;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [media] mxl111sf: fix a couple precedence bugs Negate has higher precedence than bitwise AND. I2C_M_RD is 0x1 so the original code is equivelent to just checking if (!msg->flags). Signed-off-by: Dan Carpenter Cc: Steven Toth Cc: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/dvb-usb/mxl111sf-i2c.c b/drivers/media/dvb/dvb-usb/mxl111sf-i2c.c index a330987f7e11..2e8c288258a9 100644 --- a/drivers/media/dvb/dvb-usb/mxl111sf-i2c.c +++ b/drivers/media/dvb/dvb-usb/mxl111sf-i2c.c @@ -453,7 +453,7 @@ static int mxl111sf_i2c_hw_xfer_msg(struct mxl111sf_state *state, mxl_i2c("addr: 0x%02x, read buff len: %d, write buff len: %d", msg->addr, (msg->flags & I2C_M_RD) ? msg->len : 0, - (!msg->flags & I2C_M_RD) ? msg->len : 0); + (!(msg->flags & I2C_M_RD)) ? msg->len : 0); for (index = 0; index < 26; index++) buf[index] = USB_END_I2C_CMD; @@ -489,7 +489,7 @@ static int mxl111sf_i2c_hw_xfer_msg(struct mxl111sf_state *state, ret = mxl111sf_i2c_send_data(state, 0, buf); /* write data on I2C bus */ - if ((!msg->flags & I2C_M_RD) && (msg->len > 0)) { + if (!(msg->flags & I2C_M_RD) && (msg->len > 0)) { mxl_i2c("%d\t%02x", msg->len, msg->buf[0]); /* control register on I2C interface to initialize I2C bus */