From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web11.3453.1587636690429663777 for ; Thu, 23 Apr 2020 03:11:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=PZi1zn7c; spf=pass (domain: nuviainc.com, ip: 209.85.221.66, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f66.google.com with SMTP id b11so6145292wrs.6 for ; Thu, 23 Apr 2020 03:11:30 -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:in-reply-to:user-agent; bh=3wc4xN7gaEktsB8+J8mLdxezaOeK/SScOgrVhuvaxYQ=; b=PZi1zn7czP9Gr/qvowOlnzqXrsfA5EP0ya/qZmY6C83chCWPVIxW/R3+2N9INwWWkc /JoKdd7Fj3otMdntqm67oOp82MtD1xb+GKq10CXrMG2dB/gMkWLdmY7d95+WJumf9ArT 6u6Exb7YnYf7eCO6TV8UK2WGepom3c3czPhSe1zPZ52IsRxbFTLZ3Y4zfzSvW4OFtG3F rEvJF+/F5Hjtdmt6+rYaSkiczbVk3d4LhBv8hm5dTXCR46HnPNBQzQ02hX6FQ8FfMpVe eTKC4on+Xs/OPYLnR4LQzmsbxfSQPhscf9v96P793uCeRvUpB5pw/HZNmFcwFkaAPwLd xS6w== 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:in-reply-to:user-agent; bh=3wc4xN7gaEktsB8+J8mLdxezaOeK/SScOgrVhuvaxYQ=; b=cwsnCgIbUqH04HGYihXOHYz5FfJHzT64+PVNby2J53tF3MRGzKWnUByaq42xe9bdz8 h8ieNZ7Yeys+SCZBz3vYyqH8qnXNiVS/byYqXnBnCkJW039MNPTElw8ixg3+wV/oF1p1 MrwxbFp662UTl8v2wajFeCLJ0NZJBqQVqWEEkHe0lIx8mM7ecZL6O1Iyv0Dc9X8OEa+q H/eBE4Eeya2GpX1heCPqF2u8z+IRS9Q8MewrassSIahU1nV1n9bj1Wc7HdTRzhNuTQLV aY/6fWm0LZIAd+Ds24NUTmyzg1PaKH7dQZWe4z3rxB4Xxurwn8IeywOmXCVjEC/Cz/Sc 6UXA== X-Gm-Message-State: AGi0PuZkPkYhK+Jq82Ea1twRqpHPxmu9p+pdaGtY4SGXCfek0+77lyED PwTN1mkc5QylSwxkyFFFm1xBvA== X-Google-Smtp-Source: APiQypInfLtzQvXU3gHtf5tA1TQ5y0S9/GwnY6TDCq75E4/0ruLWdcooWUrq72Bagun1ScKxDGg83w== X-Received: by 2002:adf:97de:: with SMTP id t30mr4200127wrb.135.1587636688845; Thu, 23 Apr 2020 03:11:28 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id r20sm2832193wmh.26.2020.04.23.03.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 03:11:28 -0700 (PDT) Date: Thu, 23 Apr 2020 11:11:26 +0100 From: "Leif Lindholm" To: Pankaj Bansal Cc: Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton , Ard Biesheuvel Subject: Re: [PATCH edk2-platforms v3 15/24] Silicon: NXP: Remove direct calls to SwapMmio* APIs Message-ID: <20200423101126.GV14075@vanye> References: <20200415121342.9246-1-pankaj.bansal@oss.nxp.com> <20200415121342.9246-16-pankaj.bansal@oss.nxp.com> MIME-Version: 1.0 In-Reply-To: <20200415121342.9246-16-pankaj.bansal@oss.nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Actually... On Wed, Apr 15, 2020 at 17:43:33 +0530, Pankaj Bansal wrote: > From: Pankaj Bansal > > The SwapMmio** APIs are supposed to be called indirectly via > GetMmioOperations** APIs. > Therefore, remove the SwapMmio** APIs from IoAccessLib.h and make > these APIs STATIC to IoAccessLib.c, so that no accidental call can > be made to these. > > Signed-off-by: Pankaj Bansal > --- > > Notes: > - New commit > > Silicon/NXP/Include/Library/IoAccessLib.h | 236 +------------------- > Silicon/NXP/Library/IoAccessLib/IoAccessLib.c | 17 +- > Silicon/NXP/Library/SocLib/Chassis.c | 10 +- > 3 files changed, 22 insertions(+), 241 deletions(-) > > diff --git a/Silicon/NXP/Library/SocLib/Chassis.c b/Silicon/NXP/Library/SocLib/Chassis.c > index 90677f0f36ca..d7bc55c9d275 100644 > --- a/Silicon/NXP/Library/SocLib/Chassis.c > +++ b/Silicon/NXP/Library/SocLib/Chassis.c > @@ -30,11 +30,11 @@ GurRead ( > IN UINTN Address > ) > { > - if (FixedPcdGetBool (PcdGurBigEndian)) { > - return SwapMmioRead32 (Address); > - } else { > - return MmioRead32 (Address); > - } > + MMIO_OPERATIONS_32 *GurOps; > + > + GurOps = GetMmioOperations32 (FixedPcdGetBool (PcdGurBigEndian)); > + > + return GurOps->Read32 (Address); This bit didn't jump out at me, but when I looked at 16/24 I nearly choked on my coffee. When the IoAccessLib was being reviewed, I requested that the 16/32/64-bit accessors be merged (https://edk2.groups.io/g/devel/message/34403). They ended up not being, and I didn't notice so pushed the result anyway. I have sent out a patch for review/test to do this, but it will need to go in before this patch - and it *will* require changes to this one: MMIO_OPERATIONS_32 -> MMIO_OPERATIONS GetMmioOperations32 -> GetMmioOperations If those changes are done, there is no need for me to re-review this one. Regards, Leif > } > > /* > -- > 2.17.1 >