From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from huawei.com (huawei.com [45.249.212.35]) by mx.groups.io with SMTP id smtpd.web12.33124.1599445398359224414 for ; Sun, 06 Sep 2020 19:23:20 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: huawei.com, ip: 45.249.212.35, mailfrom: xiewenyi2@huawei.com) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 2D9AE573950D53D7D4C5; Mon, 7 Sep 2020 10:23:13 +0800 (CST) Received: from [127.0.0.1] (10.174.153.72) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020 10:23:08 +0800 Subject: Re: [PATCH] EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macros To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Leif Lindholm , Laszlo Ersek CC: edk2-devel-groups-io , Ard Biesheuvel , Maciej Rabeda References: <20200904154541.23340-1-lersek@redhat.com> <20200904161644.GO20124@vanye> <20200904164217.GP20124@vanye> From: "wenyi,xie" Message-ID: Date: Mon, 7 Sep 2020 10:23:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.0.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.174.153.72] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2020/9/5 1:04, Philippe Mathieu-Daud=C3=A9 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 evalu= ate to >>>> 0 (of type "int"). They are also unused (they could never be used fo= r >>>> division, for example); so remove them. The macros were originally >>>> introduced in commit 0f4386e775c7 ("ArmPlatformPkg/PL031RealTimeCloc= kLib: >>>> Implement PL031 RTC drive", 2011-06-11). >>>> >>>> Cc: Ard Biesheuvel >>>> Cc: Leif Lindholm >>>> Cc: Maciej Rabeda >>>> Cc: Philippe Mathieu-Daud=C3=83=C6=92=C3=82=C2=A9 >>>> 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. >>> We should fix this, but possibly by correcting the macros instead of >>> deleting them? >=20 > I'm not sure how to fix, not all months have 30 days... >=20 > Reviewed-by: Philippe Mathieu-Daude >=20 >>> >>> / >>> 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) 3= 600) >>>> #define SEC_PER_DAY ((UINTN) 86= 400) >>>> -#define SEC_PER_MONTH ((UINTN) 2= ,592,000) >>>> -#define SEC_PER_YEAR ((UINTN) 31= ,536,000) >>>> =20 >>>> BOOLEAN >>>> EFIAPI >>>> --=20 >>>> 2.19.1.3.g30247aa5d201 >>>> >> >=20 >=20