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.web11.867.1599239101657419037 for ; Fri, 04 Sep 2020 10:05:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VPZyNXR4; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599239100; 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:autocrypt:autocrypt; bh=+0qjFQXMxv7lq18KVf6E2H/voVhqouWpFQooSuXoDSU=; b=VPZyNXR4Ikuld38zk+Ed07VSjH8sYoka8H7zQ/kKkOrS9+5GwXNAZsXQx+7JnrfWlrL638 Bztj2ARg3UywPddyNvMRK1Sr3/ZKKUYqATPHgy+tvNUffChrsdCT7OrDm7YC8WmUInbwQ8 /Xb6IjTdmwmFbgYjxPtcczobh/5lW8Y= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-per4a35sPmuFzzX5nSlz4A-1; Fri, 04 Sep 2020 13:04:59 -0400 X-MC-Unique: per4a35sPmuFzzX5nSlz4A-1 Received: by mail-wr1-f72.google.com with SMTP id b7so2521350wrn.6 for ; Fri, 04 Sep 2020 10:04:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=+0qjFQXMxv7lq18KVf6E2H/voVhqouWpFQooSuXoDSU=; b=qL8vBc3Ehn96y+OcRSHhUjSmCFK7rr9w3j9lpfM43lw2YsH0re+ZM2T2Xpls2OI3T4 ZQMF6Fpv/WdtZWJAr47aM2asidxsqBNwQdsjEnN1pS22DLRERFm8QC1UNE1MVg9lStvC Onc9FZOZou5VNB3lLHou83MCt/0zFILBL+3FqDjyqaCt+JE86ks48QTqSsfQI2QXCwI4 XQ1CFYKjZZMNe/bTOpGF7AdO0df+MoZDE1PRKWsrEY2gwwjiftTDOD+fPL8h+B/Gzhqj GQsZQxl4OHf5SOam1NT3+r/uqCB/Isr12UabWAw8oCaeDNWMsDL3RqYUmqUfDy5C/xFK 0PXw== X-Gm-Message-State: AOAM530m3JEdySOOPZa5h18mQMdsjmGDTexcbC1LfykUjeAHfcKT4qQw QVApFolv8scBp+GELCrAjMrl0IBxpdrRzngFxeOcwPjZJB38yCP6oCFGfxQhZQmA8UC4bO0E1zR 8JJhdkHzeqPEt+w== X-Received: by 2002:a5d:4247:: with SMTP id s7mr8444351wrr.167.1599239097921; Fri, 04 Sep 2020 10:04:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIFBiPccg+pQTNqyGEj/wUlJxi8sGM/vsznltox8QWqIDYVa/FFShVeVh3DcHOS5KpQbgIBw== X-Received: by 2002:a5d:4247:: with SMTP id s7mr8444325wrr.167.1599239097641; Fri, 04 Sep 2020 10:04:57 -0700 (PDT) Return-Path: Received: from [192.168.1.36] (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id m125sm13236486wme.35.2020.09.04.10.04.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Sep 2020 10:04:56 -0700 (PDT) Subject: Re: [PATCH] EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macros To: Leif Lindholm , Laszlo Ersek , xiewenyi2@huawei.com Cc: edk2-devel-groups-io , Ard Biesheuvel , Maciej Rabeda References: <20200904154541.23340-1-lersek@redhat.com> <20200904161644.GO20124@vanye> <20200904164217.GP20124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bQIWnvScyHxFCv33kHe+YEIqoJlaQc JfKYlbCoubz+02E2A6bFD9+BvCY0LBbEj5POwyKGiDMjHKCGuzSuDRbCn0Mz4kCa7nFMF5Jv piC+JemRdiBd6102ThqgIsyGEBXuf1sy0QIVyXgaqr9O2b/0VoXpQId7yY7OJuYYxs7kQoXI 6WzSMpmuXGkmfxOgbc/L6YbzB0JOriX0iRClxu4dEUg8Bs2pNnr6huY2Ft+qb41RzCJvvMyu gS32LfN0bTZ6Qm2A8ayMtUQgnwZDSO23OKgQWZVglGliY3ezHZ6lVwC24Vjkmq/2yBSLakZE 6DZUjZzCW1nvtRK05ebyK6tofRsx8xB8pL/kcBb9nCuh70aLR+5cmE41X4O+MVJbwfP5s/RW 9BFSL3qgXuXso/3XuWTQjJJGgKhB6xXjMmb1J4q/h5IuVV4juv1Fem9sfmyrh+Wi5V1IzKI7 RPJ3KVb937eBgSENk53P0gUorwzUcO+ASEo3Z1cBKkJSPigDbeEjVfXQMzNt0oDRzpQqH2vp apo2jHnidWt8BsckuWZpxcZ9+/9obQ55DyVQHGiTN39hkETy3Emdnz1JVHTU0Q== Message-ID: Date: Fri, 4 Sep 2020 19:04:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200904164217.GP20124@vanye> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@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 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). >> >> 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 >>> >