Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp197551imj; Thu, 14 Feb 2019 18:29:12 -0800 (PST) X-Google-Smtp-Source: AHgI3Iafy6UNe25zue0O0jdHseqp9M9OfNlLk7XsZJR1uRE0TmPvfEX72D1xfFYTj0oVQfgZgwon X-Received: by 2002:a63:e20a:: with SMTP id q10mr2985477pgh.206.1550197752734; Thu, 14 Feb 2019 18:29:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550197752; cv=none; d=google.com; s=arc-20160816; b=DqjhMHwi78u+8mz1E4aYtHhp3/jinTRf0ue7IGzl0IKD4TedLP0ObebECL7MR35dbF 2/hfAf3IJ2Av1mnd0w0h+/18oVUZacPrZK4RArio+ZA15RRwmFViUh8m3ciXURYBcYAN 3iD1Tvq1f+QQWSCw5cM18ooxpzSVU9kb/4PbqZySZuY7qi+wsHrsMS6IzvAOqnSEoXJ0 41jefO7QGIy2Suwggc2TfXiSsFVtr7YLRxBTZMXcE1Zv8Lh1nTPWflcrZmOLDGTThr/W PMXSjc4sMHbBKglzE49INC3Un7BdeLF06sFzvSFpqueY3v8E7fLipEZP+MsMTDfV4ZOJ W80g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CnjO1xoaWNrJQgIPHFmj7/92S2f4EMGitRP7ki30pM0=; b=Etp2AI7g2YO/e86/P1RPm/uOdNWrV4ZG+6MX9SapG+CmA+c2Rju7ztItLWvVdkwBDS GQWcjIl30nn82j5bThBNqgmKgsWE4Keaw4flNuAcO51QHuMhS6F0QmLiUTanEDjwDOf1 d5KqXOKBEkEG150lPkm3hSzJ/JUoUszLIrtcwWqh/RRJTIjfbfgwqVQdr9N09wESg75P 5gSqkGCw9xjHJSKO9y/MAthiqipa2LDCTiGw4KqF7FWmo4tMFhvDHxmGpVbHa2j9e5sR sXeGex2Zziroh981y2k/HRkHHZm3yVYmRaGp5hMrcapTbxxHAn95zab0xJuY21up2ucm 8C4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jm6oUiIN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2si4310035pfv.210.2019.02.14.18.28.56; Thu, 14 Feb 2019 18:29:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jm6oUiIN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387947AbfBOCJd (ORCPT + 99 others); Thu, 14 Feb 2019 21:09:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:49670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387637AbfBOCJb (ORCPT ); Thu, 14 Feb 2019 21:09:31 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B3CED206BA; Fri, 15 Feb 2019 02:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196570; bh=y5Vtc8YidNoTw9PwpTl6UrIpFn1CINVZFcLTZgF8b44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jm6oUiINJeSpic4DZIGGs8W6U1qZKShFz3ofC6eq0a/LErv159YXdkTOqP8b6YIGz FETSn6nwEcxTrJQbUAQKT4AAXupA319KLHlH4TcvFdQAYDQplVV29Ai1eWY35rv8kG Pq6KC0OF2OpADMbFpdAFnOQwaWj6veipFwlBuiEI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexandre Belloni , Shuah Khan , Sasha Levin , linux-rtc@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 18/77] selftests: rtc: rtctest: fix alarm tests Date: Thu, 14 Feb 2019 21:07:56 -0500 Message-Id: <20190215020855.176727-18-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandre Belloni [ Upstream commit fdac94489c4d247088b3885875b39b3e1eb621ef ] Return values for select are not checked properly and timeouts may not be detected. Signed-off-by: Alexandre Belloni Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/rtc/rtctest.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c index e20b017e7073..dea4e3d6d9e1 100644 --- a/tools/testing/selftests/rtc/rtctest.c +++ b/tools/testing/selftests/rtc/rtctest.c @@ -145,15 +145,12 @@ TEST_F(rtc, alarm_alm_set) { rc = select(self->fd + 1, &readfds, NULL, NULL, &tv); ASSERT_NE(-1, rc); - EXPECT_NE(0, rc); + ASSERT_NE(0, rc); /* Disable alarm interrupts */ rc = ioctl(self->fd, RTC_AIE_OFF, 0); ASSERT_NE(-1, rc); - if (rc == 0) - return; - rc = read(self->fd, &data, sizeof(unsigned long)); ASSERT_NE(-1, rc); TH_LOG("data: %lx", data); @@ -202,7 +199,7 @@ TEST_F(rtc, alarm_wkalm_set) { rc = select(self->fd + 1, &readfds, NULL, NULL, &tv); ASSERT_NE(-1, rc); - EXPECT_NE(0, rc); + ASSERT_NE(0, rc); rc = read(self->fd, &data, sizeof(unsigned long)); ASSERT_NE(-1, rc); -- 2.19.1