Patchwork [2/2] lib: fwts_smbios: fix build error with non-Intel architectures

login
register
mail settings
Submitter Colin King
Date Dec. 7, 2012, 9:05 a.m.
Message ID <1354871151-11593-3-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/204433/
State Accepted
Headers show

Comments

Colin King - Dec. 7, 2012, 9:05 a.m.
From: Colin Ian King <colin.king@canonical.com>

The dummy no-op fwts_smbios_find_entry() for non-Intel builds
is causing build failures because of the -Wextra flag.  Clean
this up and make it return empty dummy values.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_smbios.c | 7 +++++++
 1 file changed, 7 insertions(+)
Keng-Yu Lin - Dec. 10, 2012, 7:11 a.m.
On Fri, Dec 7, 2012 at 5:05 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The dummy no-op fwts_smbios_find_entry() for non-Intel builds
> is causing build failures because of the -Wextra flag.  Clean
> this up and make it return empty dummy values.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_smbios.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
> index b9c4540..705f02b 100644
> --- a/src/lib/src/fwts_smbios.c
> +++ b/src/lib/src/fwts_smbios.c
> @@ -132,6 +132,13 @@ void *fwts_smbios_find_entry(fwts_framework *fw,
>         fwts_smbios_type  *type,
>         uint16_t          *version)
>  {
> +       FWTS_UNUSED(fw);
> +
> +       /* Return a dummy values */
> +       memset(entry, 0, sizeof(fwts_smbios_entry));
> +       *type = FWTS_SMBIOS_UNKNOWN;
> +       *version = 0;
> +
>         return NULL;
>  }
>  #endif
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Dec. 13, 2012, 9:57 a.m.
On 12/07/2012 05:05 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The dummy no-op fwts_smbios_find_entry() for non-Intel builds
> is causing build failures because of the -Wextra flag.  Clean
> this up and make it return empty dummy values.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_smbios.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
> index b9c4540..705f02b 100644
> --- a/src/lib/src/fwts_smbios.c
> +++ b/src/lib/src/fwts_smbios.c
> @@ -132,6 +132,13 @@ void *fwts_smbios_find_entry(fwts_framework *fw,
>   	fwts_smbios_type  *type,
>   	uint16_t	  *version)
>   {
> +	FWTS_UNUSED(fw);
> +
> +	/* Return a dummy values */
> +	memset(entry, 0, sizeof(fwts_smbios_entry));
> +	*type = FWTS_SMBIOS_UNKNOWN;
> +	*version = 0;
> +
>   	return NULL;
>   }
>   #endif
>
Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
index b9c4540..705f02b 100644
--- a/src/lib/src/fwts_smbios.c
+++ b/src/lib/src/fwts_smbios.c
@@ -132,6 +132,13 @@  void *fwts_smbios_find_entry(fwts_framework *fw,
 	fwts_smbios_type  *type,
 	uint16_t	  *version)
 {
+	FWTS_UNUSED(fw);
+
+	/* Return a dummy values */
+	memset(entry, 0, sizeof(fwts_smbios_entry));
+	*type = FWTS_SMBIOS_UNKNOWN;
+	*version = 0;
+
 	return NULL;
 }
 #endif