From patchwork Thu Aug 16 12:00:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 958253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41rlKC1YQzz9s2P for ; Thu, 16 Aug 2018 22:00:47 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 706D43E6B34 for ; Thu, 16 Aug 2018 14:00:44 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id 582213E64DE for ; Thu, 16 Aug 2018 14:00:32 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 7FBD010009F9 for ; Thu, 16 Aug 2018 14:00:31 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F37CFACE5; Thu, 16 Aug 2018 12:00:30 +0000 (UTC) From: Richard Palethorpe To: ltp@lists.linux.it Date: Thu, 16 Aug 2018 14:00:18 +0200 Message-Id: <20180816120020.11042-2-rpalethorpe@suse.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180816120020.11042-1-rpalethorpe@suse.com> References: <20180816120020.11042-1-rpalethorpe@suse.com> X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Cc: Richard Palethorpe Subject: [LTP] [PATCH v3 2/4] tst_timer: Convert to new library X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" So we can use functions from new lib. Signed-off-by: Richard Palethorpe --- lib/tst_timer.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/tst_timer.c b/lib/tst_timer.c index 53ff36777..d5e4c49d2 100644 --- a/lib/tst_timer.c +++ b/lib/tst_timer.c @@ -23,7 +23,9 @@ #include -#include "test.h" +#define TST_NO_DEFAULT_MAIN + +#include "tst_test.h" #include "tst_timer.h" #include "tst_clocks.h" #include "lapi/posix_clocks.h" @@ -59,13 +61,13 @@ void tst_timer_check(clockid_t clk_id) { if (tst_clock_gettime(clk_id, &start_time)) { if (errno == EINVAL) { - tst_brkm(TCONF, NULL, + tst_brk(TCONF, "Clock id %s(%u) not supported by kernel", clock_name(clk_id), clk_id); return; } - tst_brkm(TBROK | TERRNO, NULL, "tst_clock_gettime() failed"); + tst_brk(TBROK | TERRNO, "tst_clock_gettime() failed"); } } @@ -74,7 +76,7 @@ void tst_timer_start(clockid_t clk_id) clock_id = clk_id; if (tst_clock_gettime(clock_id, &start_time)) - tst_resm(TWARN | TERRNO, "tst_clock_gettime() failed"); + tst_res(TWARN | TERRNO, "tst_clock_gettime() failed"); } int tst_timer_expired_ms(long long ms) @@ -82,7 +84,7 @@ int tst_timer_expired_ms(long long ms) struct timespec cur_time; if (tst_clock_gettime(clock_id, &cur_time)) - tst_resm(TWARN | TERRNO, "tst_clock_gettime() failed"); + tst_res(TWARN | TERRNO, "tst_clock_gettime() failed"); return tst_timespec_diff_ms(cur_time, start_time) >= ms; } @@ -90,7 +92,7 @@ int tst_timer_expired_ms(long long ms) void tst_timer_stop(void) { if (tst_clock_gettime(clock_id, &stop_time)) - tst_resm(TWARN | TERRNO, "tst_clock_gettime() failed"); + tst_res(TWARN | TERRNO, "tst_clock_gettime() failed"); } struct timespec tst_timer_elapsed(void)