public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Laszlo Ersek <lersek@redhat.com>, Ming Huang <huangming23@huawei.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
	"Ard Biesheuvel" <ard.biesheuvel@arm.com>,
	"Maciej Rabeda" <maciej.rabeda@linux.intel.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH] EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macros
Date: Fri, 4 Sep 2020 17:16:44 +0100	[thread overview]
Message-ID: <20200904161644.GO20124@vanye> (raw)
In-Reply-To: <20200904154541.23340-1-lersek@redhat.com>

+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 <ard.biesheuvel@arm.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reported-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

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?

/
    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
> 

  reply	other threads:[~2020-09-04 16:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 15:45 [PATCH] EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macros Laszlo Ersek
2020-09-04 16:16 ` Leif Lindholm [this message]
2020-09-04 16:42   ` Leif Lindholm
2020-09-04 17:04     ` Philippe Mathieu-Daudé
2020-09-07  2:23       ` wenyi,xie
2020-09-07 16:22         ` Leif Lindholm
2020-09-08 10:43           ` [edk2-devel] " Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200904161644.GO20124@vanye \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox