From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web10.17370.1599561804035103291 for ; Tue, 08 Sep 2020 03:43:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jAnPkw3A; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599561803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E9l+qtCF4BoU5eHT+0j/DxoGmA7Ushi+OPInC6MAfQg=; b=jAnPkw3Av1cc7sqKsjlhummg6bsTUO26QKwHmoNrbqdH5gEUXAFEt3zqqiGSs8UX4KyJ7R 3QWFntQHlWL+XW25h3O0fNSCQyTuSmtlcgZL97xuqVChFhS4HqOFTLn40qCg3NW++pqtTZ o/a7uFq96OhcZ+uqOQokO9MAAIxXfk4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-DP7sA6x4Mku29loNjn5zVg-1; Tue, 08 Sep 2020 06:43:17 -0400 X-MC-Unique: DP7sA6x4Mku29loNjn5zVg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE257801F9A; Tue, 8 Sep 2020 10:43:15 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-122.ams2.redhat.com [10.36.112.122]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED4675D9E2; Tue, 8 Sep 2020 10:43:13 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macros To: devel@edk2.groups.io, leif@nuviainc.com, "xiewenyi (A)" Cc: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Ard Biesheuvel , Maciej Rabeda References: <20200904154541.23340-1-lersek@redhat.com> <20200904161644.GO20124@vanye> <20200904164217.GP20124@vanye> <20200907162209.GA5623@vanye> From: "Laszlo Ersek" Message-ID: <6ca9cea4-8c93-4bb0-66d1-b4cce137821c@redhat.com> Date: Tue, 8 Sep 2020 12:43:13 +0200 MIME-Version: 1.0 In-Reply-To: <20200907162209.GA5623@vanye> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US On 09/07/20 18:22, Leif Lindholm wrote: > On Mon, Sep 07, 2020 at 10:23:08 +0800, xiewenyi (A) wrote: >> On 2020/9/5 1:04, Philippe Mathieu-Daudé wrote: >>> On 9/4/20 6:42 PM, Leif Lindholm wrote: >>>> Ming bounced, adding xiewenyi2. >>>> >>>> On Fri, Sep 04, 2020 at 17:16:44 +0100, Leif Lindholm wrote: >>>>> +Ming >>>>> >>>>> On Fri, Sep 04, 2020 at 17:45:41 +0200, Laszlo Ersek wrote: >>>>>> The SEC_PER_MONTH and SEC_PER_YEAR macros are wrong: they both evaluate to >>>>>> 0 (of type "int"). They are also unused (they could never be used for >>>>>> division, for example); so remove them. The macros were originally >>>>>> introduced in commit 0f4386e775c7 ("ArmPlatformPkg/PL031RealTimeClockLib: >>>>>> Implement PL031 RTC drive", 2011-06-11). >>>>>> >>>>>> Cc: Ard Biesheuvel >>>>>> Cc: Leif Lindholm >>>>>> Cc: Maciej Rabeda >>>>>> Cc: Philippe Mathieu-Daudé >>>>>> Reported-by: Maciej Rabeda >>>>>> Signed-off-by: Laszlo Ersek >>>>> >>>>> Hmm, these are used in a couple of Hisilicon libraries in >>>>> edk2-platforms. Cleary, they are not now functioning as expected (but >>>>> they never invoke these macros for division). >>>>> >> >> Hi, >> >> I search for these two macros but don't find them in Hisilicon, and also I try to >> compile D06, D05, D03 in Hisilicon after deleting these two macros, there's no >> compile error. >> >> So I think it's not used in Hisilicon libraries. > > Err, ignore me, I somehow got the impression we were deleting all of > the SEC_PER_ macros. > Go ahead: > Reviewed-by: Leif Lindholm Thanks! (To Phil as well)! Merged as commit f94345d9eae1, via . Laszlo > >>>>> We should fix this, but possibly by correcting the macros instead of >>>>> deleting them? >>> >>> I'm not sure how to fix, not all months have 30 days... >>> >>> Reviewed-by: Philippe Mathieu-Daude >>> >>>>> >>>>> / >>>>> Leif (goes back to now hopefuly lit barbecue) >>>>> >>>>>> --- >>>>>> EmbeddedPkg/Include/Library/TimeBaseLib.h | 2 -- >>>>>> 1 file changed, 2 deletions(-) >>>>>> >>>>>> diff --git a/EmbeddedPkg/Include/Library/TimeBaseLib.h b/EmbeddedPkg/Include/Library/TimeBaseLib.h >>>>>> index ee2f191d985b..3c2d3660c66c 100644 >>>>>> --- a/EmbeddedPkg/Include/Library/TimeBaseLib.h >>>>>> +++ b/EmbeddedPkg/Include/Library/TimeBaseLib.h >>>>>> @@ -51,8 +51,6 @@ >>>>>> #define SEC_PER_MIN ((UINTN) 60) >>>>>> #define SEC_PER_HOUR ((UINTN) 3600) >>>>>> #define SEC_PER_DAY ((UINTN) 86400) >>>>>> -#define SEC_PER_MONTH ((UINTN) 2,592,000) >>>>>> -#define SEC_PER_YEAR ((UINTN) 31,536,000) >>>>>> >>>>>> BOOLEAN >>>>>> EFIAPI >>>>>> -- >>>>>> 2.19.1.3.g30247aa5d201 >>>>>> >>>> >>> >>> >> > > >