lkml.org 
[lkml]   [2015]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/7] selftest/timers: Quiet warning due to lack of return check on brk
Date
The posix_timers.c test has a loop that tries to keep it in
kernel space, repeatedly calling brk(). Since its noise, and
a failure won't change what the test would do, add a unused
value to quiet the warning.

Cc: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
tools/testing/selftests/timers/posix_timers.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c
index f87d970..3e04cc0 100644
--- a/tools/testing/selftests/timers/posix_timers.c
+++ b/tools/testing/selftests/timers/posix_timers.c
@@ -35,10 +35,11 @@ static void user_loop(void)
static void kernel_loop(void)
{
void *addr = sbrk(0);
+ int unused;

while (!done) {
- brk(addr + 4096);
- brk(addr);
+ unused = brk(addr + 4096);
+ unused = brk(addr);
}
}

--
1.9.1


\
 
 \ /
  Last update: 2015-02-05 08:01    [W:0.061 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site