From patchwork Wed Feb 6 19:35:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 10799955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 04B0D746 for ; Wed, 6 Feb 2019 19:35:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7FCA2C82B for ; Wed, 6 Feb 2019 19:35:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB53C2CF17; Wed, 6 Feb 2019 19:35:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F9562C82B for ; Wed, 6 Feb 2019 19:35:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726832AbfBFTfy (ORCPT ); Wed, 6 Feb 2019 14:35:54 -0500 Received: from cloud.peff.net ([104.130.231.41]:35000 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726708AbfBFTfy (ORCPT ); Wed, 6 Feb 2019 14:35:54 -0500 Received: (qmail 14236 invoked by uid 109); 6 Feb 2019 19:35:54 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Wed, 06 Feb 2019 19:35:54 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 4740 invoked by uid 111); 6 Feb 2019 19:36:03 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) SMTP; Wed, 06 Feb 2019 14:36:03 -0500 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Wed, 06 Feb 2019 14:35:52 -0500 Date: Wed, 6 Feb 2019 14:35:52 -0500 From: Jeff King To: Johannes Schindelin Cc: Junio C Hamano , git@vger.kernel.org Subject: [PATCH] test-date: drop unused parameter to getnanos() Message-ID: <20190206193552.GA6539@sigill.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The getnanos() helper always gets the current time from our getnanotime() facility. The caller cannot override it via TEST_DATE_NOW, and hence we simply ignore the "now" parameter to the function. Let's remove it, as it may mislead callers into thinking it does something. Signed-off-by: Jeff King --- This goes on the js/vsts-ci branch. Noticed by merging 'next' with my -Wunused-parameters work-in-progress. :) t/helper/test-date.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/helper/test-date.c b/t/helper/test-date.c index 792a805374..f9e2b91ed1 100644 --- a/t/helper/test-date.c +++ b/t/helper/test-date.c @@ -83,7 +83,7 @@ static void parse_approx_timestamp(const char **argv, struct timeval *now) } } -static void getnanos(const char **argv, struct timeval *now) +static void getnanos(const char **argv) { double seconds = getnanotime() / 1.0e9; @@ -119,7 +119,7 @@ int cmd__date(int argc, const char **argv) else if (!strcmp(*argv, "timestamp")) parse_approx_timestamp(argv+1, &now); else if (!strcmp(*argv, "getnanos")) - getnanos(argv+1, &now); + getnanos(argv+1); else if (!strcmp(*argv, "is64bit")) return sizeof(timestamp_t) == 8 ? 0 : 1; else if (!strcmp(*argv, "time_t-is64bit"))