summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-01-17 10:45:54 +0100
committerWolfram Sang <wolfram@the-dreams.de>2013-02-10 19:55:22 +0100
commit05cf936846ca6aef1b34ba26054728fdbc154558 (patch)
tree30ef22b64d0f1ac71fbfdf33da9417efc3b71f59 /drivers/i2c
parent626f0a2ff6bc9820b17c17958d5862262556892f (diff)
downloadlinux-3.10-05cf936846ca6aef1b34ba26054728fdbc154558.tar.gz
linux-3.10-05cf936846ca6aef1b34ba26054728fdbc154558.tar.bz2
linux-3.10-05cf936846ca6aef1b34ba26054728fdbc154558.zip
i2c: sh_mobile: cosmetic: trivially simplify 2 functions
Reduce 2 boolean functions from "if (condition) return 1; return 0;" to "return condition;" Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index b6e7a83a829..34024f3a19f 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -349,20 +349,14 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd,
return ret;
}
-static int sh_mobile_i2c_is_first_byte(struct sh_mobile_i2c_data *pd)
+static bool sh_mobile_i2c_is_first_byte(struct sh_mobile_i2c_data *pd)
{
- if (pd->pos == -1)
- return 1;
-
- return 0;
+ return pd->pos == -1;
}
-static int sh_mobile_i2c_is_last_byte(struct sh_mobile_i2c_data *pd)
+static bool sh_mobile_i2c_is_last_byte(struct sh_mobile_i2c_data *pd)
{
- if (pd->pos == (pd->msg->len - 1))
- return 1;
-
- return 0;
+ return pd->pos == pd->msg->len - 1;
}
static void sh_mobile_i2c_get_data(struct sh_mobile_i2c_data *pd,