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.1256.1599236208663932443 for ; Fri, 04 Sep 2020 09:16:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=IqKPlSHq; spf=pass (domain: nuviainc.com, ip: 209.85.221.68, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f68.google.com with SMTP id j2so7293422wrx.7 for ; Fri, 04 Sep 2020 09:16:48 -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=Un3zckcL8dj08w0Zq3bGK3s7RjHvHrhbvUDfF3WZHKw=; b=IqKPlSHqPNcpI6C9JJoNLgdvs7ifoKnmHqk3Zr3vCrAriqzcAuf2+ezWMv7C6m1CZy ZuP5O6e22z7rfHrFDoqvoo2E9bBuwNTWOnxfYzIPC9EcgcWbFUIsixKsrY6Zb0bPryRF TKgOByY3D7VND7lhE8gPGfaQRAOlXUZ4oJOMxUjvbE6fpYopfRODjDZ4ebU0S0DZjLDQ 0CjSVUQYK/QVrqfNqE/XBrnwmObvCQeURgX38ZWphktMmAo8J3aBoNDpvW8PRvoybleL aI6fqmyKk4es2ufsj3v8T6GsTmiD3R7b7cMUo2B0ClB0Ga5Trgqh/nuDyyQXSKyY6oVW 8Wjw== 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=Un3zckcL8dj08w0Zq3bGK3s7RjHvHrhbvUDfF3WZHKw=; b=uHnWkhGqG2t0yqNGvzC47+K63EDb7KiKHqjhpXLyrFoGXSPPp5yO5UwXyDospmYMsV hHAwJ1sGi/Yu6RiXbkGynBjNEeeA+3ZEeLLAQnOntuWKYlQfyYIwlUr8hKLW9gtiKKEo e6Qtw/6aasgZqj6Xc2WY/6upehoDh6V4BmBQHiizR2wA3Fy/GxTf9sFIBV3MxPkq93Nb 9J5lD+DtzSM8V8SLh88ffLimrF+aNdmJqAS1ir0c3SOEVbV02omEzTQSEenmGUVC+/6G eU1wjuCZkejcVkmbgn4guObJoc7x3xxIChFWwvAKJZAi/XXYPyKKDv9B6fbUWoFVHZIW Ji8A== X-Gm-Message-State: AOAM531JZaEifxRY1uAM+wLxJRh1vcSO17lL0RymGxZYkLZiQ2Vl3C3m uXJ/8cbK7VKDL5DEulLAUfFeYA== X-Google-Smtp-Source: ABdhPJy9/g6xcipH2dKqHQyTf9J2OTXm89P5+KxYduQiqnjjDUmCOaUgSPLP32pOvWJSCXY02cn47A== X-Received: by 2002:adf:f245:: with SMTP id b5mr8841189wrp.288.1599236207124; Fri, 04 Sep 2020 09:16:47 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id d190sm13171310wmd.23.2020.09.04.09.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 09:16:46 -0700 (PDT) Date: Fri, 4 Sep 2020 17:16:44 +0100 From: "Leif Lindholm" To: Laszlo Ersek , Ming Huang Cc: edk2-devel-groups-io , Ard Biesheuvel , Maciej Rabeda , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Subject: Re: [PATCH] EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macros Message-ID: <20200904161644.GO20124@vanye> References: <20200904154541.23340-1-lersek@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200904154541.23340-1-lersek@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit +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? / 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 >