Commit 4be8daa1 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

vdso01 test: fix for clang

clang complains:
> clang -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../lib/arch/x86/include -I../lib   vdso01.c ../lib/libzdtmtst.a ../lib/libzdtmtst.a -lrt -o vdso01
> vdso01.c:305:6: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value
>       [-Werror,-Wabsolute-value]
>         if (abs(ts1.tv_sec - ts2.tv_sec) > TIME_DELTA_SEC) {
>             ^
> vdso01.c:305:6: note: use function 'labs' instead

Let's use labs() indeed.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent fe21d145
...@@ -302,7 +302,7 @@ static int vdso_clock_gettime_handler(void *func) ...@@ -302,7 +302,7 @@ static int vdso_clock_gettime_handler(void *func)
test_msg("clock_gettime: tv_sec %li vdso_clock_gettime: tv_sec %li\n", test_msg("clock_gettime: tv_sec %li vdso_clock_gettime: tv_sec %li\n",
ts1.tv_sec, ts2.tv_sec); ts1.tv_sec, ts2.tv_sec);
if (abs(ts1.tv_sec - ts2.tv_sec) > TIME_DELTA_SEC) { if (labs(ts1.tv_sec - ts2.tv_sec) > TIME_DELTA_SEC) {
pr_perror("Delta is too big"); pr_perror("Delta is too big");
return -1; return -1;
} }
...@@ -333,7 +333,7 @@ static int vdso_gettimeofday_handler(void *func) ...@@ -333,7 +333,7 @@ static int vdso_gettimeofday_handler(void *func)
test_msg("gettimeofday: tv_sec %li vdso_gettimeofday: tv_sec %li\n", test_msg("gettimeofday: tv_sec %li vdso_gettimeofday: tv_sec %li\n",
tv1.tv_sec, tv2.tv_sec); tv1.tv_sec, tv2.tv_sec);
if (abs(tv1.tv_sec - tv2.tv_sec) > TIME_DELTA_SEC) { if (labs(tv1.tv_sec - tv2.tv_sec) > TIME_DELTA_SEC) {
pr_perror("Delta is too big"); pr_perror("Delta is too big");
return -1; return -1;
} }
...@@ -351,7 +351,7 @@ static int vdso_time_handler(void *func) ...@@ -351,7 +351,7 @@ static int vdso_time_handler(void *func)
test_msg("time: %li vdso_time: %li\n", (long)t1, (long)t1); test_msg("time: %li vdso_time: %li\n", (long)t1, (long)t1);
if (abs(t1 - t2) > TIME_DELTA_SEC) { if (labs(t1 - t2) > TIME_DELTA_SEC) {
pr_perror("Delta is too big"); pr_perror("Delta is too big");
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment