summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElad Wexler <elad.wexler@gmail.com>2013-09-12 12:28:54 +0200
committerJohn Stultz <john.stultz@linaro.org>2013-09-17 20:19:27 +0200
commit233bcb411cd32d15c4d04271fa06ca8f2dc24eb8 (patch)
tree95c3488b678b00241c97c52dc6015c05e285bf10
parentMerge branch 'fortglx/3.12/time' into fortglx/3.13/time (diff)
downloadlinux-233bcb411cd32d15c4d04271fa06ca8f2dc24eb8.tar.xz
linux-233bcb411cd32d15c4d04271fa06ca8f2dc24eb8.zip
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>
-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,
struct device_attribute *attr,
const char *buf, size_t count)
{
- size_t ret;
+ ssize_t ret;
mutex_lock(&clocksource_mutex);
@@ -968,7 +968,7 @@ static ssize_t sysfs_unbind_clocksource(struct device *dev,
{
struct clocksource *cs;
char name[CS_NAME_LEN];
- size_t ret;
+ ssize_t ret;
ret = sysfs_get_uname(buf, name, count);
if (ret < 0)