aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorElad Wexler <elad.wexler@gmail.com>2013-09-12 06:28:54 -0400
committerJohn Stultz <john.stultz@linaro.org>2013-09-17 14:19:27 -0400
commit233bcb411cd32d15c4d04271fa06ca8f2dc24eb8 (patch)
tree95c3488b678b00241c97c52dc6015c05e285bf10 /kernel/time
parent389e067032fbb96e439abafae848dd447e4cafb4 (diff)
clocksource: Fix 'ret' data type of sysfs_override_clocksource() and sysfs_unbind_clocksource()
sysfs_override_clocksource(): The expression 'if (ret >= 0)' is always true. This will cause clocksource_select() to always run. Thus modified ret to be of type ssize_t. sysfs_unbind_clocksource(): The expression 'if (ret < 0)' is always false. So in case sysfs_get_uname() failed, the expression won't take an effect. Thus modified ret to be of type ssize_t. Signed-off-by: Elad Wexler <elad.wexler@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/clocksource.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 64cf63ca09cc..c9317e14aae6 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -940,7 +940,7 @@ static ssize_t sysfs_override_clocksource(struct device *dev,
940 struct device_attribute *attr, 940 struct device_attribute *attr,
941 const char *buf, size_t count) 941 const char *buf, size_t count)
942{ 942{
943 size_t ret; 943 ssize_t ret;
944 944
945 mutex_lock(&clocksource_mutex); 945 mutex_lock(&clocksource_mutex);
946 946
@@ -968,7 +968,7 @@ static ssize_t sysfs_unbind_clocksource(struct device *dev,
968{ 968{
969 struct clocksource *cs; 969 struct clocksource *cs;
970 char name[CS_NAME_LEN]; 970 char name[CS_NAME_LEN];
971 size_t ret; 971 ssize_t ret;
972 972
973 ret = sysfs_get_uname(buf, name, count); 973 ret = sysfs_get_uname(buf, name, count);
974 if (ret < 0) 974 if (ret < 0)