From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ryszard.knop@linux.intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 096CC211BFCB5 for ; Wed, 30 Jan 2019 04:37:47 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2019 04:37:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="316130800" Received: from linux.intel.com ([10.54.29.200]) by fmsmga005.fm.intel.com with ESMTP; 30 Jan 2019 04:37:46 -0800 Received: from torii (torii.igk.intel.com [10.102.24.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 77DA258042B; Wed, 30 Jan 2019 04:37:44 -0800 (PST) Message-ID: <3cf87ed5545cf13d3e76dc92d44565777e6ac5d2.camel@linux.intel.com> From: Ryszard Knop To: Ard Biesheuvel , edk2-devel@lists.01.org, Philippe Mathieu-Daud? Cc: kamil.kacperski@intel.com, eric.jin@intel.com, pawel.orlowski@intel.com, michael.d.kinney@intel.com, harry.l.hsiung@intel.com Date: Wed, 30 Jan 2019 13:37:42 +0100 In-Reply-To: <02cd4706-221e-3f21-f652-efcdc378973c@redhat.com> References: <20181106175833.26964-1-ard.biesheuvel@linaro.org> <20181106175833.26964-10-ard.biesheuvel@linaro.org> <02cd4706-221e-3f21-f652-efcdc378973c@redhat.com> Organization: Intel Corporation User-Agent: Evolution 3.30.4 Mime-Version: 1.0 Subject: Re: [PATCH edk2-staging 09/19] IntelUndiPkg/GigUndiDxe: add missing UINT8* cast X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 12:37:48 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On Tue, 2018-11-06 at 21:31 +0100, philmd at redhat.com wrote: > Hi Ard, > > On 6/11/18 18:58, Ard Biesheuvel wrote: > > UINT8 and CHAR8 are not the same underlying type on all > > architectures, > > so add an explicit cast where necessary. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Ard Biesheuvel > > --- > > IntelUndiPkg/GigUndiDxe/Hii.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/IntelUndiPkg/GigUndiDxe/Hii.c > > b/IntelUndiPkg/GigUndiDxe/Hii.c > > index a5d8ae207819..737a59fbbbac 100644 > > --- a/IntelUndiPkg/GigUndiDxe/Hii.c > > +++ b/IntelUndiPkg/GigUndiDxe/Hii.c > > @@ -817,7 +817,7 @@ HiiSetMenuStrings ( > > > > Status = ReadPbaString ( > > &UndiPrivateData->NicInfo, > > - PBAString8, > > + (UINT8 *)PBAString8, > > MAX_PBA_STR_LENGTH > > ); > > if (Status == EFI_SUCCESS) { > > > > I'm not sure why ReadPbaString() takes UINT8* instead of CHAR8*. > Having the device part number stored into a CHAR8[] seems correct, > what > do you think? I agree that it should use CHAR8, but the underlying code in e1000_nvm.c is shared between multiple drivers expecting uint8_t or equivalent, so as Ard said it'd just move the problem elsewhere. It'd be nice to keep this conversion in ReadPbaString, but as this is the only place where this function is used, it's fine for now. Hii.c and friends overall need some solid refactoring if time allows.