From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web10.88448.1684156968572599346 for ; Mon, 15 May 2023 06:22:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kmRfUy9n; spf=pass (domain: gmail.com, ip: 209.85.210.177, mailfrom: pedro.falcato@gmail.com) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-643912bca6fso9972411b3a.0 for ; Mon, 15 May 2023 06:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684156968; x=1686748968; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qZSnHlcs2gMNxQGU5DMG+ZArylnMEP07vw5cpMTLeT8=; b=kmRfUy9nnLZYiFvqfnPAKog005ZepALTzQSUQAVAW73P5t+pgf2vGuijlZaDUmSJJT o0EvaJwiOD/edjMnRe4Hls1gINqWK0yXSrEqISIV6Zr+U/ACAlLJeKPBzMi+YpFCbA5Q FpQqHGkUE9aLpjLHXlurrulymIZXB9m1YL1OUGHgaX0ZlhHCH1kQiSeCCTmiJit+ixlP ySbIb2uidyz4BoY3YDbFSV3BcDOaxENLtQW2DORUyEw6C348f9GTA6ZkeYnZYps8zqTT glEk+23VU/V75Jaryz0OB2MbcFqBk3xgDue9BDglLbQ3HBVzZf3zVQJkc1gahWMR8LCq EpKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684156968; x=1686748968; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qZSnHlcs2gMNxQGU5DMG+ZArylnMEP07vw5cpMTLeT8=; b=PPwEvWvqNFwtmO0hra3CjqGplSALl79OikIt5oqph27ZEatPXz6GYYSJ+urRWWmLrU tLynUMDLD7PKSxYG8aSygawrH4gVWrxQZLGZqUvvkmcN57KyV9oZTHj7WOUO7CINNzJb Yc2ASOsmoyxS+w0tkVFUlrrFnbtT2Sle3JBETXgwj7IzeB+BCcxCY4zNXlmZMwAf20hN 5+vsqW1IM++sc6miul6NBr5drsg9mte8O56i1Kwgc9SE7QzGY6MVojZVBPzcz1a0WL9i kPAyDdjS6D/pJwN4Uua8/MRlo1KnEGDYvvplWj7pV2TlcElZqgO0u4Tf4YdWROnoIyR0 MSqw== X-Gm-Message-State: AC+VfDzzTqKWVsSK2ypedoKNL7VymVTY+kyfI9D/62eburBRTKrFT9Vt Obl6O1X89BaidQO+TtUpMRRB8E7flhtZJB2/LHjUvHMKnFE= X-Google-Smtp-Source: ACHHUZ4l6g3bJUcTZOxDSYPR629Tks+ZGyIkUOnK2qhANrtyIyp7ZZbP0vXP0vv8FMwSs0OAKivlytgGSH++ZdgwduY= X-Received: by 2002:a05:6a20:7da9:b0:100:95ca:b1e1 with SMTP id v41-20020a056a207da900b0010095cab1e1mr35535120pzj.37.1684156967736; Mon, 15 May 2023 06:22:47 -0700 (PDT) MIME-Version: 1.0 References: <20230515054329.3224434-1-rebecca@bsdio.com> <20230515054329.3224434-2-rebecca@bsdio.com> In-Reply-To: <20230515054329.3224434-2-rebecca@bsdio.com> From: "Pedro Falcato" Date: Mon, 15 May 2023 14:22:36 +0100 Message-ID: Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro To: devel@edk2.groups.io, rebecca@bsdio.com Cc: Chasel Chiu , Nate DeSimone , Sai Chaganty , Isaac Oram Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 15, 2023 at 6:43=E2=80=AFAM Rebecca Cran wr= ote: > > The IS_ALIGNED macro defined in PlatformBoardConfig.h conflicts with the > definition from MdePkg/Include/Base.h. Delete it, and switch to > ADDRESS_IS_ALIGNED. > > Signed-off-by: Rebecca Cran > --- > Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformB= oardConfig.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Inclu= de/PlatformBoardConfig.h b/Platform/Intel/WhiskeylakeOpenBoardPkg/Whiskeyla= keURvp/Include/PlatformBoardConfig.h > index 44b4059f8ebf..4872a0afc65a 100644 > --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/Plat= formBoardConfig.h > +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/Plat= formBoardConfig.h > @@ -15,8 +15,7 @@ > #include > #include > > -#define IS_ALIGNED(addr, size) (((addr) & (size - 1)) ? 0 : 1) > -#define ALIGN16(size) (IS_ALIGNED(size, 16) ? size : ((size + 1= 6) & 0xFFF0)) > +#define ALIGN16(size) (ADDRESS_IS_ALIGNED(size, 16) ? size : ((= size + 16) & 0xFFF0)) As I mentioned on Discord, ALIGN16 should not need a branch like this. I propose switching ALIGN16 to use ALIGN_VALUE, or if you need compat with older edk2s, even: #define ALIGN16(size) (((size) + 15) & -16) Which is a common enough pattern that it hopefully is self-explanatory. --=20 Pedro