From patchwork Thu Mar 12 00:39:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 45696 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D7110214C6 for ; Thu, 12 Mar 2015 00:40:27 +0000 (UTC) Received: by wesu56 with SMTP id u56sf9226249wes.2 for ; Wed, 11 Mar 2015 17:40:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=hhQSkwASieDOTgEaxjU9MiNljhzSS750bk9QvKk7r50=; b=FVL8XbhOtqxZYT/1N9OBvs7PVgbTJdRm71dWtJXqwkXi1yArU8rdSz00Xfkpyj9BPQ OSwZoblFMrRxF3XBPAndLPoN31ai8DWE4WBDRBh8VUXYS0ybGKUuvoSEGn9EjKM/r+yx a9EORjNakkgmiqnmQY4z+BF5j5E2cb4rM1wRvmW0I5DBPLKikCcG0TjUKsEac02bR+AU wpya8rt2omm5zfyTYV3+OP5CZBEH94u4Q+hqrTUQqF2yey7iy3xspbpO/dlsNl7ZEdKU ORixkiJMp6Ljy5lIupKKjob/q7UbCnHSf+6I7Z7JC/21BE9m9OFJUQvcp0u1kl1cp9Di 06JA== X-Gm-Message-State: ALoCoQlM2dTLGRa9Gld/oV8frT9hZQsHDgWJllePfB1hTsKSKuPS/dMGkP1meIaoeObPkFnJSf5k X-Received: by 10.194.201.10 with SMTP id jw10mr5903068wjc.3.1426120827214; Wed, 11 Mar 2015 17:40:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.69 with SMTP id i5ls159238lah.56.gmail; Wed, 11 Mar 2015 17:40:27 -0700 (PDT) X-Received: by 10.112.198.136 with SMTP id jc8mr5930392lbc.92.1426120827007; Wed, 11 Mar 2015 17:40:27 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id t4si3320559lbj.108.2015.03.11.17.40.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 17:40:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labhs14 with SMTP id hs14so11982759lab.5 for ; Wed, 11 Mar 2015 17:40:26 -0700 (PDT) X-Received: by 10.152.43.51 with SMTP id t19mr36245490lal.73.1426120826558; Wed, 11 Mar 2015 17:40:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp3098448lbj; Wed, 11 Mar 2015 17:40:25 -0700 (PDT) X-Received: by 10.67.3.196 with SMTP id by4mr83967946pad.74.1426120823043; Wed, 11 Mar 2015 17:40:23 -0700 (PDT) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com. [209.85.220.51]) by mx.google.com with ESMTPS id ae3si572239pad.73.2015.03.11.17.40.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 17:40:23 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.51 as permitted sender) client-ip=209.85.220.51; Received: by pabli10 with SMTP id li10so15774688pab.2 for ; Wed, 11 Mar 2015 17:40:22 -0700 (PDT) X-Received: by 10.70.96.165 with SMTP id dt5mr82351365pdb.119.1426120822136; Wed, 11 Mar 2015 17:40:22 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id qa1sm7783493pdb.84.2015.03.11.17.40.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Mar 2015 17:40:21 -0700 (PDT) From: John Stultz To: Linux Kernel Mailing List Cc: John Stultz , Shuah Khan , Prarit Bhargava , Thomas Gleixner , Richard Cochran Subject: [PATCH 02/19] selftests/timers: Quiet warning due to lack of return check on brk Date: Wed, 11 Mar 2015 17:39:58 -0700 Message-Id: <1426120815-32528-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426120815-32528-1-git-send-email-john.stultz@linaro.org> References: <1426120815-32528-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The posix_timers.c test has a loop that tries to keep it in kernel space, repeatedly calling brk(). However, it doesn't check the return value, which causes warnings. This patch adds a err value which captures the return value and modifies the test so it will quit if a failure occurs. Cc: Shuah Khan Cc: Prarit Bhargava Cc: Thomas Gleixner Cc: Richard Cochran Signed-off-by: John Stultz --- tools/testing/selftests/timers/posix_timers.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c index f87d970..5a246a0 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 err = 0; - while (!done) { - brk(addr + 4096); - brk(addr); + while (!done && !err) { + err = brk(addr + 4096); + err |= brk(addr); } } @@ -190,8 +191,6 @@ static int check_timer_create(int which) int main(int argc, char **argv) { - int err; - printf("Testing posix timers. False negative may happen on CPU execution \n"); printf("based timers if other threads run on the CPU...\n");