diff mbox series

[1/2] efi_loader: add missing const qualifier

Message ID 20211022112426.25009-2-masahisa.kojima@linaro.org
State Accepted
Commit f86352eb825a450d298b9c1a2b88c07b523c1039
Headers show
Series add selftest for EFI_TCG2_PROTOCOL and Measured Boot | expand

Commit Message

Masahisa Kojima Oct. 22, 2021, 11:24 a.m. UTC
This commit fixes the following compilation warning
of boottime->install_configuration_table() function.

---
lib/efi_selftest/efi_selftest_tcg2.c:475:46:
warning: passing argument 1 of ‘boottime->install_configuration_table’
discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  ret = boottime->install_configuration_table(&smbios_guid, dmi);
---

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>

---
 include/efi_api.h             | 2 +-
 lib/efi_loader/efi_boottime.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

-- 
2.17.1

Comments

Heinrich Schuchardt Oct. 23, 2021, 8:40 a.m. UTC | #1
On 10/22/21 13:24, Masahisa Kojima wrote:
> This commit fixes the following compilation warning

> of boottime->install_configuration_table() function.

>

> ---

> lib/efi_selftest/efi_selftest_tcg2.c:475:46:

> warning: passing argument 1 of ‘boottime->install_configuration_table’

> discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]

>    ret = boottime->install_configuration_table(&smbios_guid, dmi);

> ---

>

> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>


The first --- separates the commit message from the rest of the patch:

$ scripts/checkpatch.pl 0001-efi_loader-add-missing-const-qualifier.patch
ERROR: Missing Signed-off-by: line by nominal patch author 'Masahisa
Kojima <masahisa.kojima@linaro.org>'

I will reformat the commit message when merging.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


> ---

>   include/efi_api.h             | 2 +-

>   lib/efi_loader/efi_boottime.c | 5 +++--

>   2 files changed, 4 insertions(+), 3 deletions(-)

>

> diff --git a/include/efi_api.h b/include/efi_api.h

> index c8f959bb72..0accad08c8 100644

> --- a/include/efi_api.h

> +++ b/include/efi_api.h

> @@ -120,7 +120,7 @@ struct efi_boot_services {

>   			struct efi_device_path **device_path,

>   			efi_handle_t *device);

>   	efi_status_t (EFIAPI *install_configuration_table)(

> -			efi_guid_t *guid, void *table);

> +			const efi_guid_t *guid, void *table);

>

>   	efi_status_t (EFIAPI *load_image)(bool boot_policiy,

>   			efi_handle_t parent_image,

> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c

> index bf5661e1ee..1823990d9b 100644

> --- a/lib/efi_loader/efi_boottime.c

> +++ b/lib/efi_loader/efi_boottime.c

> @@ -1692,8 +1692,9 @@ out:

>    *

>    * Return: status code

>    */

> -static efi_status_t EFIAPI efi_install_configuration_table_ext(efi_guid_t *guid,

> -							       void *table)

> +static efi_status_t

> +EFIAPI efi_install_configuration_table_ext(const efi_guid_t *guid,

> +					   void *table)

>   {

>   	EFI_ENTRY("%pUl, %p", guid, table);

>   	return EFI_EXIT(efi_install_configuration_table(guid, table));

>
Ilias Apalodimas Oct. 23, 2021, 5:21 p.m. UTC | #2
On Sat, 23 Oct 2021 at 11:40, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>

> On 10/22/21 13:24, Masahisa Kojima wrote:

> > This commit fixes the following compilation warning

> > of boottime->install_configuration_table() function.

> >

> > ---

> > lib/efi_selftest/efi_selftest_tcg2.c:475:46:

> > warning: passing argument 1 of ‘boottime->install_configuration_table’

> > discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]

> >    ret = boottime->install_configuration_table(&smbios_guid, dmi);

> > ---

> >

> > Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>

>

> The first --- separates the commit message from the rest of the patch:

>

> $ scripts/checkpatch.pl 0001-efi_loader-add-missing-const-qualifier.patch

> ERROR: Missing Signed-off-by: line by nominal patch author 'Masahisa

> Kojima <masahisa.kojima@linaro.org>'

>

> I will reformat the commit message when merging.

>

> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/include/efi_api.h b/include/efi_api.h
index c8f959bb72..0accad08c8 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -120,7 +120,7 @@  struct efi_boot_services {
 			struct efi_device_path **device_path,
 			efi_handle_t *device);
 	efi_status_t (EFIAPI *install_configuration_table)(
-			efi_guid_t *guid, void *table);
+			const efi_guid_t *guid, void *table);
 
 	efi_status_t (EFIAPI *load_image)(bool boot_policiy,
 			efi_handle_t parent_image,
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index bf5661e1ee..1823990d9b 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1692,8 +1692,9 @@  out:
  *
  * Return: status code
  */
-static efi_status_t EFIAPI efi_install_configuration_table_ext(efi_guid_t *guid,
-							       void *table)
+static efi_status_t
+EFIAPI efi_install_configuration_table_ext(const efi_guid_t *guid,
+					   void *table)
 {
 	EFI_ENTRY("%pUl, %p", guid, table);
 	return EFI_EXIT(efi_install_configuration_table(guid, table));