public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Jin, Eric" <eric.jin@intel.com>
Subject: Re: [PATCH edk2-staging 09/19] IntelUndiPkg/GigUndiDxe: add missing UINT8* cast
Date: Wed, 7 Nov 2018 10:08:12 +0100	[thread overview]
Message-ID: <d334844a-bcd0-9762-9ca5-1dc64b324c96@redhat.com> (raw)
In-Reply-To: <CAKv+Gu8n_c7j-N7xz1bzD5CadkRfTCSYOA+=_cuqF2nTma5oeQ@mail.gmail.com>

On 6/11/18 21:35, Ard Biesheuvel wrote:
> On 6 November 2018 at 21:31, Philippe Mathieu-Daudé <philmd@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 <ard.biesheuvel@linaro.org>
>>> ---
>>>    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 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) == 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) == 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)

Hmm I now see the inconsistency.

Since the goal of this series is not to sort it out, then I'm OK with 
your patch.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  reply	other threads:[~2018-11-07  9:15 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 17:58 [PATCH edk2-staging 00/19] IntelUndiPkg/GigUndiDxe: build fixes for AARCH64/ARM/GCC Ard Biesheuvel
2018-11-06 17:58 ` [PATCH edk2-staging 01/19] IntelOpenSourceUndiPkg.dsc: add AARCH64 and ARM to supported architectures Ard Biesheuvel
2019-01-29 13:54   ` Ryszard Knop
2019-01-29 14:04     ` Ard Biesheuvel
2018-11-06 17:58 ` [PATCH edk2-staging 02/19] IntelUndiPkg: remove EOF markers Ard Biesheuvel
2018-11-06 19:34   ` Philippe Mathieu-Daudé
2019-01-29 13:58   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 03/19] IntelUndiPkg/GigUndiDxe: consistently use lowercase for e1000 in filenames Ard Biesheuvel
2018-11-06 19:35   ` Philippe Mathieu-Daudé
2019-01-29 14:21   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 04/19] IntelUndiPkg/GigUndiDxe: consistently use forward slashes as path separators Ard Biesheuvel
2018-11-06 19:37   ` Philippe Mathieu-Daudé
2019-01-29 14:26   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 05/19] IntelUndiPkg/GigUndiDxe: move BRAND_STRUCT declaration after type definition Ard Biesheuvel
2019-01-29 16:02   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 06/19] IntelUndiPkg/GigUndiDxe: use intermediate UINTN casts for pointers Ard Biesheuvel
2019-01-30 10:59   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 07/19] IntelUndiPkg/GigUndiDxe: create GCC alternatives for MSFT build options Ard Biesheuvel
2019-01-30 11:48   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 08/19] IntelUndiPkg/GigUndiDxe: add missing VOID** cast Ard Biesheuvel
2018-11-07  9:16   ` Philippe Mathieu-Daudé
2018-11-07 14:05   ` Philippe Mathieu-Daudé
2019-01-30 12:05   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 09/19] IntelUndiPkg/GigUndiDxe: add missing UINT8* cast Ard Biesheuvel
2018-11-06 20:31   ` Philippe Mathieu-Daudé
2018-11-06 20:35     ` Ard Biesheuvel
2018-11-07  9:08       ` Philippe Mathieu-Daudé [this message]
2019-01-30 12:37     ` Ryszard Knop
2019-01-30 12:30   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 10/19] IntelUndiPkg/GigUndiDxe: add missing braces to GUID literals Ard Biesheuvel
2018-11-06 20:34   ` Philippe Mathieu-Daudé
2019-01-30 12:59   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 11/19] IntelUndiPkg/GigUndiDxe: fix incorrect use of CPP token pasting Ard Biesheuvel
2019-01-30 13:35   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 12/19] IntelUndiPkg/GigUndiDxe: cast E1000MemCopy () args to correct pointer type Ard Biesheuvel
2018-11-06 20:35   ` Philippe Mathieu-Daudé
2019-01-30 13:37   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 13/19] IntelUndiPkg/GigUndiDxe: don't take address of cast expression Ard Biesheuvel
2018-11-06 20:36   ` Philippe Mathieu-Daudé
2019-01-30 13:41   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 14/19] IntelUndiPkg/GigUndiDxe: redefine UNREFERENCED_nPARAMETER macros for GCC Ard Biesheuvel
2018-11-06 17:58 ` [PATCH edk2-staging 15/19] IntelUndiPkg/GigUndiDxe: remove forward declaration of non-existent function Ard Biesheuvel
2018-11-06 20:40   ` Philippe Mathieu-Daudé
2019-01-30 15:26   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 16/19] IntelUndiPkg/GigUndiDxe: fix incorrect indentation Ard Biesheuvel
2018-11-06 20:41   ` Philippe Mathieu-Daudé
2018-11-06 17:58 ` [PATCH edk2-staging 17/19] IntelUndiPkg/GigUndiDxe: move MSFT warning overrides to INF file Ard Biesheuvel
2019-01-30 14:09   ` Ryszard Knop
2018-11-06 17:58 ` [PATCH edk2-staging 18/19] IntelUndiPkg/GigUndiDxe: add missing EFIAPI modifiers Ard Biesheuvel
2019-01-30 15:15   ` Ryszard Knop
2019-01-30 15:20     ` Ard Biesheuvel
2019-01-30 15:31       ` Ryszard Knop
2019-01-30 15:33         ` Ard Biesheuvel
2018-11-06 17:58 ` [PATCH edk2-staging 19/19] IntelUndiPkg/GigUndiDxe: remove or reorganize unused variables Ard Biesheuvel
2018-11-07  9:08   ` Philippe Mathieu-Daudé
2019-01-30 14:32   ` Ryszard Knop
2018-11-06 22:10 ` [PATCH edk2-staging 00/19] IntelUndiPkg/GigUndiDxe: build fixes for AARCH64/ARM/GCC Kinney, Michael D
2018-11-06 23:03   ` Ard Biesheuvel
2018-11-09 17:54     ` Knop, Ryszard
2018-11-09 18:00       ` Ard Biesheuvel
2018-11-07 14:56   ` Leif Lindholm
2019-01-29 13:13 ` Ryszard Knop
2019-01-29 13:55   ` Ryszard Knop
2019-03-27 15:32     ` Ard Biesheuvel
2019-03-28 10:46       ` Ryszard Knop
2019-03-28 11:38         ` Ard Biesheuvel
2020-01-07 12:49           ` [edk2-devel] " Maciej Rabeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d334844a-bcd0-9762-9ca5-1dc64b324c96@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox