From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d42; helo=mail-io1-xd42.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DB8F32117B54F for ; Tue, 6 Nov 2018 12:35:21 -0800 (PST) Received: by mail-io1-xd42.google.com with SMTP id k17-v6so10262482ioc.4 for ; Tue, 06 Nov 2018 12:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LWE+MMn1s02aPuC/bI3ZJKrke8Vz9k42MXzzC3/c4dE=; b=idHLIPzS3DXC2UwHa9Qu7DHDd/hiijFComMZTMD3fPmUeQCoGfCNUlL6kj4YEQDusw VjMyAOGQ3kFD22qCoPzl1X7qKTwdpCWwtjyN0Iqb5iYZADl45kMO6GTNa+Z+IloYYy+9 m6brXrUGI9BsMTzNCi/K4chtBAWs1X/YCQjBE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LWE+MMn1s02aPuC/bI3ZJKrke8Vz9k42MXzzC3/c4dE=; b=t7smHcLSIKtoCierU7x8S4rV9qxO3IUidP9JxGBKPqPR9gjXULxjjCMzN3Z27xOvsA zEVNsYMP3NYO1aQA5GbtRbbMnWCtC8CaXP3fdyjTNKhcIipaDQVQVnjrF3OpRLEX9UHS +8JvsF0wGN35clwwJLpfU8BE8ETTr30jzD+E6R089aUadV/4OWoJTTJU1njwUDtnA8h+ C7M0yLRV9tvZk4SMiNMqrLiDKYIbLfqMt856Fpb5+52X35WSXJhMIJcEAbZUWxsqPsXd vRJoYMfZmUbvfNM9cQEQHLiL+P2sEsIsxc7uiitBn+PXco+gwVuZjvNmEnjUc1XP1dTR INiQ== X-Gm-Message-State: AGRZ1gLjky9JqLO8Dq4EEpx9Na/Q9zJiawgpVxzh4UlkunJ4xXVvlrRm mMunX7y2a67DoI6nBtC9N1539R+7GsByvlCySnHuoA== X-Google-Smtp-Source: AJdET5daLet7HpLkF2sQiZIsrLL6YXd2UJnmirPxo+bR69LgUzYKDlt6ExmFQLHZx8I8M1P62PSmnqPgLQh7OsvwCnc= X-Received: by 2002:a6b:3707:: with SMTP id e7-v6mr23678651ioa.60.1541536520958; Tue, 06 Nov 2018 12:35:20 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a6b:4f16:0:0:0:0:0 with HTTP; Tue, 6 Nov 2018 12:35:19 -0800 (PST) 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> From: Ard Biesheuvel Date: Tue, 6 Nov 2018 21:35:20 +0100 Message-ID: To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Cc: "edk2-devel@lists.01.org" , "Kinney, Michael D" , "Jin, Eric" 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: Tue, 06 Nov 2018 20:35:23 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 6 November 2018 at 21:31, Philippe Mathieu-Daud=C3=A9 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 =3D ReadPbaString ( >> &UndiPrivateData->NicInfo, >> - PBAString8, >> + (UINT8 *)PBAString8, >> MAX_PBA_STR_LENGTH >> ); >> if (Status =3D=3D 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 d= o > you think? I guess. But that just moves the bubble in the waterbed to elsewhere: EFI_STATUS ReadPbaString ( IN GIG_DRIVER_DATA *GigAdapter, IN OUT UINT8 * PbaNumber, IN UINT32 PbaNumberSize ) { if (e1000_read_pba_string (&GigAdapter->Hw, PbaNumber, PbaNumberSize) =3D=3D E1000_SUCCESS) { return EFI_SUCCESS; } else { return EFI_DEVICE_ERROR; } } and $ git grep e1000_read_pba_string IntelUndiPkg/GigUndiDxe/e1000.c: if (e1000_read_pba_string (&GigAdapter->Hw, PbaNumber, PbaNumberSize) =3D=3D E1000_SUCCESS) { IntelUndiPkg/GigUndiDxe/e1000_api.c: * e1000_read_pba_string - Read device part number string IntelUndiPkg/GigUndiDxe/e1000_api.c:s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size) IntelUndiPkg/GigUndiDxe/e1000_api.c: return e1000_read_pba_string_generic(hw, pba_num, pba_num_size); IntelUndiPkg/GigUndiDxe/e1000_api.h:s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); IntelUndiPkg/GigUndiDxe/e1000_nvm.c: * e1000_read_pba_string_generic - Read device part number IntelUndiPkg/GigUndiDxe/e1000_nvm.c:s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, IntelUndiPkg/GigUndiDxe/e1000_nvm.c: DEBUGFUNC("e1000_read_pba_string_generic"); IntelUndiPkg/GigUndiDxe/e1000_nvm.h:s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, (unless you want to add a cast in ReadPbaString() instead)