From patchwork Mon Mar 2 21:09:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 45317 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 88456214B5 for ; Mon, 2 Mar 2015 21:10:26 +0000 (UTC) Received: by wibbs8 with SMTP id bs8sf11699075wib.2 for ; Mon, 02 Mar 2015 13:10:25 -0800 (PST) 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=Psm4yEB2jK1OAcreoJomsp+njROrP57VNdmHD/HfU44X5kYe/KWoT6AwVDn0Sc/LQl p3xoP3MdlHXgCVGrHBe/EVMAnQwF9Mj9C0YR7YcSzy5COTpozu/XyvANPf0Lyzp7OGx8 C60Xf/Rapl8TNzFwzOxTnXBtRvxSqPY6AcBoSvDIstcM84yyu8dSJO01EhEzR5fldIOq S63NC7d90MiF6/PVeKwz/uyd9BgovyN46grvdAgpmRyP0/HsiwnFyE/MAa6umZ39udQI tMDywTTZqPKoSOSgCKMmuRxVEYkyFtsYmMXhsfwEv/pdGRBI0TMjKm2lnWsFspe0CnW1 /kqg== X-Gm-Message-State: ALoCoQnZSi9h5AN4rVj2A6VHVId+lr0Ucz56TOTLlGbm0Kj0sRfVMnINuOl9tBXPExCWod8NnHIv X-Received: by 10.152.6.232 with SMTP id e8mr4083510laa.2.1425330625773; Mon, 02 Mar 2015 13:10:25 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.98 with SMTP id m2ls500249lae.5.gmail; Mon, 02 Mar 2015 13:10:25 -0800 (PST) X-Received: by 10.152.23.233 with SMTP id p9mr26329963laf.123.1425330625626; Mon, 02 Mar 2015 13:10:25 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id w11si9762174lby.28.2015.03.02.13.10.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 13:10:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labge10 with SMTP id ge10so33174192lab.12 for ; Mon, 02 Mar 2015 13:10:25 -0800 (PST) X-Received: by 10.112.204.197 with SMTP id la5mr25809208lbc.29.1425330625499; Mon, 02 Mar 2015 13:10:25 -0800 (PST) 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 h5csp158185lbj; Mon, 2 Mar 2015 13:10:24 -0800 (PST) X-Received: by 10.68.168.101 with SMTP id zv5mr50772209pbb.104.1425330621954; Mon, 02 Mar 2015 13:10:21 -0800 (PST) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com. [209.85.192.179]) by mx.google.com with ESMTPS id pk10si9993776pbb.40.2015.03.02.13.10.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 13:10:21 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.179 as permitted sender) client-ip=209.85.192.179; Received: by pdbnh10 with SMTP id nh10so16678050pdb.4 for ; Mon, 02 Mar 2015 13:10:21 -0800 (PST) X-Received: by 10.68.200.134 with SMTP id js6mr50403823pbc.55.1425330621054; Mon, 02 Mar 2015 13:10:21 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id ym10sm11765258pac.10.2015.03.02.13.10.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Mar 2015 13:10:20 -0800 (PST) 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: Mon, 2 Mar 2015 13:09:55 -0800 Message-Id: <1425330612-24280-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425330612-24280-1-git-send-email-john.stultz@linaro.org> References: <1425330612-24280-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.51 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");