diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-09-21 09:33:41 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2015-12-11 01:41:05 -0500 |
commit | 3b44edaaa1fffccea7edc018dd807581c97a6aea (patch) | |
tree | 19acec5d276b5e114daaea3a39879bc525aef4d6 /tools | |
parent | 390dd67c471a43a8a0f36c7d5177de49e7749c59 (diff) |
selftests/timers: fix write return value handlng
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/timers/clocksource-switch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c index 627ec7425f78..fd88e3025bed 100644 --- a/tools/testing/selftests/timers/clocksource-switch.c +++ b/tools/testing/selftests/timers/clocksource-switch.c | |||
@@ -97,7 +97,7 @@ int get_cur_clocksource(char *buf, size_t size) | |||
97 | int change_clocksource(char *clocksource) | 97 | int change_clocksource(char *clocksource) |
98 | { | 98 | { |
99 | int fd; | 99 | int fd; |
100 | size_t size; | 100 | ssize_t size; |
101 | 101 | ||
102 | fd = open("/sys/devices/system/clocksource/clocksource0/current_clocksource", O_WRONLY); | 102 | fd = open("/sys/devices/system/clocksource/clocksource0/current_clocksource", O_WRONLY); |
103 | 103 | ||