ACK: [PATCH 2/8] acpi: syntaxcheck: add in extra error level messages
Alex Hung
alex.hung at canonical.com
Mon Mar 4 09:44:31 UTC 2013
On 02/27/2013 10:40 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> add extra error level messages and add better guarding so we don't
> fall off the end of the arrary.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpi/syntaxcheck/syntaxcheck.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/syntaxcheck/syntaxcheck.c b/src/acpi/syntaxcheck/syntaxcheck.c
> index 5aee063..e4616d9 100644
> --- a/src/acpi/syntaxcheck/syntaxcheck.c
> +++ b/src/acpi/syntaxcheck/syntaxcheck.c
> @@ -48,6 +48,8 @@ static void syntaxcheck_free_advice(void);
> #define ASL_WARNING2 1
> #define ASL_WARNING3 2
> #define ASL_ERROR 3
> +#define ASL_REMARK 4
> +#define ASL_OPTIMIZATION 5
>
> static int syntaxcheck_init(fwts_framework *fw)
> {
> @@ -75,13 +77,14 @@ static const char *syntaxcheck_error_level(uint32_t error_code)
> "warning (level 1)",
> "warning (level 2)",
> "error",
> + "remark",
> + "optimization",
> "unknown",
> };
>
> - if (error_level > 3)
> - error_level = 4;
> + const int max_levels = (sizeof(error_levels) / sizeof(char*)) - 1;
>
> - return error_levels[error_level];
> + return error_levels[error_level > max_levels ? max_levels : error_level];
> }
>
> /*
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list