[PATCH 1/2] lib: fwts_cmos: fix build error with non-Intel architectures
Keng-Yu Lin
kengyu at canonical.com
Mon Dec 10 07:10:50 UTC 2012
On Fri, Dec 7, 2012 at 5:05 PM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The dummy no-op CMOS fwts_cmos_read() for non-Intel builds
> is causing build failures because of the -Wextra flag:
>
> fwts_cmos.c: In function 'fwts_cmos_read':
> fwts_cmos.c:53:34: error: unused parameter 'offset' [-Werror=unused-parameter]
> fwts_cmos.c:53:51: error: unused parameter 'value' [-Werror=unused-parameter]
>
> This fixes this and makes the no-op function return a known garbage
> value.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_cmos.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/lib/src/fwts_cmos.c b/src/lib/src/fwts_cmos.c
> index 583bbb4..7b0ca40 100644
> --- a/src/lib/src/fwts_cmos.c
> +++ b/src/lib/src/fwts_cmos.c
> @@ -52,6 +52,10 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value)
> #else
> int fwts_cmos_read(const uint8_t offset, uint8_t *value)
> {
> + FWTS_UNUSED(offset);
> +
> + *value = ~0; /* Fake a failed read */
> +
> return FWTS_ERROR;
> }
> #endif
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>
More information about the fwts-devel
mailing list