[PATCH] apic: apicedge: minor code tidy-up

Keng-Yu Lin kengyu at canonical.com
Fri Apr 26 02:08:06 UTC 2013


On Wed, Apr 24, 2013 at 5:21 PM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Minor code tidy-up, reformatted, etc.  No significant change.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/apic/apicedge/apicedge.c | 20 ++++++++++++--------
>  1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/src/apic/apicedge/apicedge.c b/src/apic/apicedge/apicedge.c
> index e22080c..9737fa4 100644
> --- a/src/apic/apicedge/apicedge.c
> +++ b/src/apic/apicedge/apicedge.c
> @@ -33,9 +33,9 @@
>  /*
>   * This test sanity checks apic irq information
>   * rule of thumb:
> - * interrupts <16 should be EDGE
> - * interrupts >16 should be LEVEL
> - * acpi interrupt should be LEVEL
> + *   interrupts <16 should be EDGE
> + *   interrupts >16 should be LEVEL
> + *   acpi interrupt should be LEVEL
>   */
>
>  static int apicedge_test1(fwts_framework *fw)
> @@ -54,11 +54,11 @@ static int apicedge_test1(fwts_framework *fw)
>                 int edge = -1;
>                 int irq = 0;
>
> -               memset(line, 0, 4096);
> -               if (fgets(line, 4095, file) == NULL)
> +               memset(line, 0, sizeof(line));
> +               if (fgets(line, sizeof(line) - 1, file) == NULL)
>                         break;
>
> -               if (! (line[0]==' ' || (line[0]>='0' && line[0]<='9')) )
> +               if (! (line[0] == ' ' || (line[0] >= '0' && line[0] <= '9')) )
>                         continue;
>
>                 irq = strtoul(line, &c, 10);
> @@ -77,13 +77,17 @@ static int apicedge_test1(fwts_framework *fw)
>
>                 if (strstr(line,"acpi")) {
>                         if (edge == 1) {
> -                               fwts_failed(fw, LOG_LEVEL_MEDIUM, "ACPIIRQEdgeTrig", "ACPI Interrupt is incorrectly edge triggered.");
> +                               fwts_failed(fw, LOG_LEVEL_MEDIUM,
> +                                       "ACPIIRQEdgeTrig",
> +                                       "ACPI Interrupt is incorrectly edge triggered.");
>                                 fwts_tag_failed(fw, FWTS_TAG_BIOS_IRQ);
>                         }
>                         continue;
>                 }
>                 if ((irq < 15) && (edge == 0)) {
> -                       fwts_failed(fw, LOG_LEVEL_MEDIUM, "LegacyIRQLevelTrig", "Legacy interrupt %i is incorrectly level triggered.", irq);
> +                       fwts_failed(fw, LOG_LEVEL_MEDIUM,
> +                               "LegacyIRQLevelTrig",
> +                               "Legacy interrupt %i is incorrectly level triggered.", irq);
>                         fwts_tag_failed(fw, FWTS_TAG_BIOS_IRQ);
>                 }
>                 if ((irq < 15) && (edge == -1)) {
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>>



More information about the fwts-devel mailing list