From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: philmd@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 24 Sep 2019 08:40:49 -0700 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 117234ACDF for ; Tue, 24 Sep 2019 15:40:49 +0000 (UTC) Received: by mail-wm1-f69.google.com with SMTP id 190so225365wme.4 for ; Tue, 24 Sep 2019 08:40:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/zQGrICoZ+3eeoD6J+34zO/9VE3PUrIt0Wc9lowME5A=; b=oqTxWoxTert2sVRFfMB88rIX40YFoPCMnV7jsaGCAnR+c2GB9tgU71jDdVulvmws7I WqHYLfS01lmfl137MnEDeCOme0qYNqpCDcDCq6wPfShIDwLmKsuBRG3mSbc0kXi54eBR thJUGLmhHNruE+vDgrgB/1iPNm+35uIyS5TBHRMwVi6MULB2O85Byr1RD8lYQVhmyuoE kRXd7nvmKpoZ5Xj9/hugHiYqSFvzHPRo7iCemu117q0oU80pH4EBAi+eGEMXN9R176aF ouGpK44ZbzqYPnewaGc9JCHI4Qz9X0UQx4TqCQA7nSeI+Qrytc12Jr0azV6onHdunHuK 24DA== X-Gm-Message-State: APjAAAX9B2VqCNkeGoeOMOIc3O0UEy8npxJTA0ea/6nNScA+gxql7UqX 6gM4WARSOqtGt7yy2iP6y+gwV9xZBJmwXHHBxRzCqCXccasmAeCMCuwzXtmaTUaw42OAZ+7v6FE 3oWZe/V5Kgbao4Q== X-Received: by 2002:adf:e443:: with SMTP id t3mr2948153wrm.181.1569339647780; Tue, 24 Sep 2019 08:40:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzh5umr8jiF3qvqW28HjFaj92+gTdrSIDlALW3wmiaRLx+hzD7WXvVTTtYi7kc+U+BXlz8zFg== X-Received: by 2002:adf:e443:: with SMTP id t3mr2948143wrm.181.1569339647617; Tue, 24 Sep 2019 08:40:47 -0700 (PDT) Received: from [192.168.1.115] (240.red-88-21-68.staticip.rima-tde.net. [88.21.68.240]) by smtp.gmail.com with ESMTPSA id q15sm2953518wrg.65.2019.09.24.08.40.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Sep 2019 08:40:47 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH 13/35] MdeModulePkg: PEI Core: clean up "AprioriFile" handling in FindFileEx() To: devel@edk2.groups.io, lersek@redhat.com Cc: Dandan Bi , Hao A Wu , Jian J Wang , Liming Gao References: <20190917194935.24322-1-lersek@redhat.com> <20190917194935.24322-14-lersek@redhat.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: Date: Tue, 24 Sep 2019 17:40:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190917194935.24322-14-lersek@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 9/17/19 9:49 PM, Laszlo Ersek wrote: > Clean up two issues around FindFileEx(): > > - The "AprioriFile" parameter's type differs between the function > declaration and the function definition. The correct type is > (EFI_PEI_FILE_HANDLE*). > > - "FfsFileHeader" has type (EFI_FFS_FILE_HEADER*); for clarity, we should > cast it explicitly to EFI_PEI_FILE_HANDLE when assigning it to > (*AprioriFile). > > This is a semantic cleanup, there is no functional change. > > Cc: Dandan Bi > Cc: Hao A Wu > Cc: Jian J Wang > Cc: Liming Gao > Signed-off-by: Laszlo Ersek > --- > > Notes: > lightly tested: OVMF uses APRIORI PEI in the FDF files > > MdeModulePkg/Core/Pei/FwVol/FwVol.h | 2 +- > MdeModulePkg/Core/Pei/FwVol/FwVol.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.h b/MdeModulePkg/Core/Pei/FwVol/FwVol.h > index 4082cfbec1f8..ca80e84e0fcb 100644 > --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.h > +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.h > @@ -299,7 +299,7 @@ FindFileEx ( > IN CONST EFI_GUID *FileName, OPTIONAL > IN EFI_FV_FILETYPE SearchType, > IN OUT EFI_PEI_FILE_HANDLE *FileHandle, > - IN OUT EFI_PEI_FV_HANDLE *AprioriFile OPTIONAL > + IN OUT EFI_PEI_FILE_HANDLE *AprioriFile OPTIONAL > ); > > /** > diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c > index 709db00694c2..f4642c47c13a 100644 > --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c > +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c > @@ -407,7 +407,7 @@ FindFileEx ( > } else if (AprioriFile != NULL) { > if (FfsFileHeader->Type == EFI_FV_FILETYPE_FREEFORM) { > if (CompareGuid (&FfsFileHeader->Name, &gPeiAprioriFileNameGuid)) { > - *AprioriFile = FfsFileHeader; > + *AprioriFile = (EFI_PEI_FILE_HANDLE)FfsFileHeader; > } > } > } > Reviewed-by: Philippe Mathieu-Daude