Skip to content

Commit

Permalink
i2c: rk3x: Remove unlikely() annotations
Browse files Browse the repository at this point in the history
Having a transfer more than 32 bits is not all that unlikely.  Remove
the annotation.

The unlikely in the IRQ handler can't gain us much.  It's not in a
loop, so at most it would save 1 instruction per IRQ, which isn't
much.  In fact on the compiler I tested it produced the exact same
code.  Remove it too.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Doug Anderson authored and Wolfram Sang committed Sep 29, 2014
1 parent aa5beaf commit 2920933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-rk3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static void rk3x_i2c_prepare_read(struct rk3x_i2c *i2c)
* The hw can read up to 32 bytes at a time. If we need more than one
* chunk, send an ACK after the last byte of the current chunk.
*/
if (unlikely(len > 32)) {
if (len > 32) {
len = 32;
con &= ~REG_CON_LASTACK;
} else {
Expand Down Expand Up @@ -403,7 +403,7 @@ static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id)
}

/* is there anything left to handle? */
if (unlikely((ipd & REG_INT_ALL) == 0))
if ((ipd & REG_INT_ALL) == 0)
goto out;

switch (i2c->state) {
Expand Down

0 comments on commit 2920933

Please sign in to comment.