From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web12.825.1599495738301287390 for ; Mon, 07 Sep 2020 09:22:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=O2z/0iBw; spf=pass (domain: nuviainc.com, ip: 209.85.221.68, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f68.google.com with SMTP id k15so16338609wrn.10 for ; Mon, 07 Sep 2020 09:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=j6dfC9Bv/PBJ0XW+J2dQBqdZtNasDKgfrByYGGLlGo8=; b=O2z/0iBwhok0GesFjrzgFyogTKYPELBgfPhPCa2gV9j1NcS4OVL8zBBWkgt1bDjQ7h FIEREmHtImXwec7yc0tqbNZZ99acW86HkociXGhZMkeazU11IxqWCFRR+cHedDvP1UWR kfjhlZx/BG3qUm/3IB4m5Meb2ANR60vyWfuUCJoE0UP0Da3Ix1wnldPk0bVctW/eFbyb YZfqbLJPoGMyv3202u52Q0BYEn8sVkNFWvu4nt/WXiPRytJwpteOTExNqw7d/dQWxSla iohrEOp4cC7uhPK5pN9e51RavJ4knvKVZFrMC+Pl6V7pWlUn1B+1SclPs01dW/GDkB7F oXPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=j6dfC9Bv/PBJ0XW+J2dQBqdZtNasDKgfrByYGGLlGo8=; b=GzSKuDfaQ4dmNj766b7/cvXoKm4cOcMJFS0wQIy1a9tAJqyC6vIiCui4JSbTFNYsYH uo58cmc7MJ9EhS2TkVSbp/XEO9A1FSw/abnpU802kyDkl3KUAE5ZxSx5ZnZDuJuIdw6f c8bJXlxhj0opN+Uj/ixz7FINwxc4XdpqSB9S2JP5QiINpamxA6y4T2RB/hTPO6HaJL4T ANwm57QwpsRtbcTKEehXzlJbt81megBXTyGG3aTzc4rgrtka/mNAyk21cuuWgEi1GILH uLFtUg8Ax+ou5TRAWo6G2eXvbt18xHGGCOvuCcQBqgqeC18o98AavquRnblwku/heUW8 6yPg== X-Gm-Message-State: AOAM532JWjBtJPyFhUVwMYYUU7IVD3vbw5a7aGUkSe0D76gCsihYkVdp eHXp+NWL2gGlXJ9EWWcvl1hQTQ== X-Google-Smtp-Source: ABdhPJyWvTtJix1Sg2Q6QSsNPehZu8uDk9avraJUKRkgC79tBsF7Z65kdrALIQw1K1LuViDMReDsHg== X-Received: by 2002:adf:c3cc:: with SMTP id d12mr22773690wrg.399.1599495736818; Mon, 07 Sep 2020 09:22:16 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id a10sm26350016wmj.38.2020.09.07.09.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 09:22:16 -0700 (PDT) Date: Mon, 7 Sep 2020 17:22:09 +0100 From: "Leif Lindholm" To: "xiewenyi (A)" , Laszlo Ersek Cc: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , edk2-devel-groups-io , Ard Biesheuvel , Maciej Rabeda Subject: Re: [PATCH] EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macros Message-ID: <20200907162209.GA5623@vanye> References: <20200904154541.23340-1-lersek@redhat.com> <20200904161644.GO20124@vanye> <20200904164217.GP20124@vanye> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 > >>> 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 > >>>> > >> > > > > >