提交 baf3d7b7 编写于 作者: F Felipe Balbi 提交者: Wolfram Sang

i2c: omap: simplify num_bytes handling

trivial patch, no functional changes

If the fifo is disabled or fifo_size is 0 the num_bytes
is set to 1. Else it is set to fifo_size or in case of a
draining interrupt the remaining bytes in the buff stat.
So the zero check is redundant and can be safely optimised.
Signed-off-by: NFelipe Balbi <balbi@ti.com>
Reviewed-by : Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: NShubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
上级 d9ebd04d
...@@ -812,8 +812,7 @@ omap_i2c_isr(int this_irq, void *dev_id) ...@@ -812,8 +812,7 @@ omap_i2c_isr(int this_irq, void *dev_id)
OMAP_I2C_BUFSTAT_REG) OMAP_I2C_BUFSTAT_REG)
>> 8) & 0x3F; >> 8) & 0x3F;
} }
while (num_bytes) { while (num_bytes--) {
num_bytes--;
w = omap_i2c_read_reg(dev, OMAP_I2C_DATA_REG); w = omap_i2c_read_reg(dev, OMAP_I2C_DATA_REG);
if (dev->buf_len) { if (dev->buf_len) {
*dev->buf++ = w; *dev->buf++ = w;
...@@ -855,8 +854,7 @@ omap_i2c_isr(int this_irq, void *dev_id) ...@@ -855,8 +854,7 @@ omap_i2c_isr(int this_irq, void *dev_id)
OMAP_I2C_BUFSTAT_REG) OMAP_I2C_BUFSTAT_REG)
& 0x3F; & 0x3F;
} }
while (num_bytes) { while (num_bytes--) {
num_bytes--;
w = 0; w = 0;
if (dev->buf_len) { if (dev->buf_len) {
w = *dev->buf++; w = *dev->buf++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册