Patchwork lib: tidy up source, remove trailing whitespaces and empty lines

login
register
mail settings
Submitter Colin King
Date June 28, 2012, 12:49 p.m.
Message ID <1340887787-15596-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/167868/
State Accepted
Headers show

Comments

Colin King - June 28, 2012, 12:49 p.m.
From: Colin Ian King <colin.king@canonical.com>

After many iterations of changes we've managed to pick up a load
of trailing white spaces (space, tabs) at the end of lines and
also a bunch of extraneous empty lines, so tidy this up.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_acpi.c        |    1 -
 src/lib/src/fwts_acpi_method.c |    7 ++----
 src/lib/src/fwts_acpi_tables.c |   18 +++++++---------
 src/lib/src/fwts_acpid.c       |    2 +-
 src/lib/src/fwts_alloc.c       |   12 +++++------
 src/lib/src/fwts_args.c        |   22 +++++++++----------
 src/lib/src/fwts_battery.c     |    4 ++--
 src/lib/src/fwts_checksum.c    |    2 +-
 src/lib/src/fwts_cpu.c         |   12 +++++------
 src/lib/src/fwts_dump.c        |   11 +++++-----
 src/lib/src/fwts_formatting.c  |    6 +++---
 src/lib/src/fwts_framework.c   |   46 ++++++++++++++++++++--------------------
 src/lib/src/fwts_get.c         |    9 ++++----
 src/lib/src/fwts_gpe.c         |    8 +++----
 src/lib/src/fwts_guid.c        |    2 +-
 src/lib/src/fwts_hwinfo.c      |    2 +-
 src/lib/src/fwts_iasl.c        |    4 ++--
 src/lib/src/fwts_interactive.c |   12 +++++------
 src/lib/src/fwts_keymap.c      |    6 +++---
 src/lib/src/fwts_klog.c        |   20 ++++++++---------
 src/lib/src/fwts_log.c         |    1 -
 src/lib/src/fwts_memorymap.c   |    8 +++----
 src/lib/src/fwts_microcode.c   |    2 +-
 src/lib/src/fwts_multiproc.c   |    8 +++----
 src/lib/src/fwts_oops.c        |    4 ++--
 src/lib/src/fwts_pipeio.c      |    6 +++---
 src/lib/src/fwts_set.c         |    4 ++--
 src/lib/src/fwts_smbios.c      |   14 ++++++------
 src/lib/src/fwts_tag.c         |    1 -
 src/lib/src/fwts_text_list.c   |    2 +-
 src/lib/src/fwts_uefi.c        |    7 +++---
 src/lib/src/fwts_virt.c        |    2 +-
 src/lib/src/fwts_wakealarm.c   |    4 ++--
 33 files changed, 128 insertions(+), 141 deletions(-)
Keng-Yu Lin - July 3, 2012, 5:45 a.m.
On Thu, Jun 28, 2012 at 8:49 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> After many iterations of changes we've managed to pick up a load
> of trailing white spaces (space, tabs) at the end of lines and
> also a bunch of extraneous empty lines, so tidy this up.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_acpi.c        |    1 -
>  src/lib/src/fwts_acpi_method.c |    7 ++----
>  src/lib/src/fwts_acpi_tables.c |   18 +++++++---------
>  src/lib/src/fwts_acpid.c       |    2 +-
>  src/lib/src/fwts_alloc.c       |   12 +++++------
>  src/lib/src/fwts_args.c        |   22 +++++++++----------
>  src/lib/src/fwts_battery.c     |    4 ++--
>  src/lib/src/fwts_checksum.c    |    2 +-
>  src/lib/src/fwts_cpu.c         |   12 +++++------
>  src/lib/src/fwts_dump.c        |   11 +++++-----
>  src/lib/src/fwts_formatting.c  |    6 +++---
>  src/lib/src/fwts_framework.c   |   46 ++++++++++++++++++++--------------------
>  src/lib/src/fwts_get.c         |    9 ++++----
>  src/lib/src/fwts_gpe.c         |    8 +++----
>  src/lib/src/fwts_guid.c        |    2 +-
>  src/lib/src/fwts_hwinfo.c      |    2 +-
>  src/lib/src/fwts_iasl.c        |    4 ++--
>  src/lib/src/fwts_interactive.c |   12 +++++------
>  src/lib/src/fwts_keymap.c      |    6 +++---
>  src/lib/src/fwts_klog.c        |   20 ++++++++---------
>  src/lib/src/fwts_log.c         |    1 -
>  src/lib/src/fwts_memorymap.c   |    8 +++----
>  src/lib/src/fwts_microcode.c   |    2 +-
>  src/lib/src/fwts_multiproc.c   |    8 +++----
>  src/lib/src/fwts_oops.c        |    4 ++--
>  src/lib/src/fwts_pipeio.c      |    6 +++---
>  src/lib/src/fwts_set.c         |    4 ++--
>  src/lib/src/fwts_smbios.c      |   14 ++++++------
>  src/lib/src/fwts_tag.c         |    1 -
>  src/lib/src/fwts_text_list.c   |    2 +-
>  src/lib/src/fwts_uefi.c        |    7 +++---
>  src/lib/src/fwts_virt.c        |    2 +-
>  src/lib/src/fwts_wakealarm.c   |    4 ++--
>  33 files changed, 128 insertions(+), 141 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi.c b/src/lib/src/fwts_acpi.c
> index 34316b1..e014d3a 100644
> --- a/src/lib/src/fwts_acpi.c
> +++ b/src/lib/src/fwts_acpi.c
> @@ -39,7 +39,6 @@ char *fwts_acpi_fadt_preferred_pm_profile[] = {
>         "Performance Server",
>  };
>
> -
>  /*
>   *  fwts_acpi_table_get_header()
>   *     copy into ACPI table header from raw data
> diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
> index 5c2e3da..4a0e7ec 100644
> --- a/src/lib/src/fwts_acpi_method.c
> +++ b/src/lib/src/fwts_acpi_method.c
> @@ -109,11 +109,9 @@ static acpi_eval_error  errors[] = {
>         { 0,                            0,                      NULL,                   NULL }
>  };
>
> -
>  static fwts_list *fwts_object_names;
>  static bool fwts_method_initialized = false;
>
> -
>  /*
>   *  fwts_method_init()
>   *     Initialise ACPIA engine and collect method namespace
> @@ -149,7 +147,6 @@ int fwts_method_deinit(fwts_framework *fw)
>         return ret;
>  }
>
> -
>  /*
>   *  fwts_method_get_names()
>   *     return list of method names
> @@ -159,8 +156,8 @@ fwts_list *fwts_method_get_names(void)
>         return fwts_object_names;
>  }
>
> -/*
> - *  fwts_method_exists()
> +/*
> + *  fwts_method_exists()
>   *     return first matching name
>   */
>  char *fwts_method_exists(char *name)
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index 042c3ec..bd47e99 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -125,7 +125,7 @@ static void *fwts_acpi_load_table(const off_t addr)
>         void *mem;
>         void *table;
>         int len;
> -
> +
>         if ((hdr = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_header))) == FWTS_MAP_FAILED)
>                 return NULL;
>
> @@ -143,7 +143,7 @@ static void *fwts_acpi_load_table(const off_t addr)
>
>         memcpy(table, mem, len);
>         (void)fwts_munmap(mem, len);
> -
> +
>         return table;
>  }
>
> @@ -317,7 +317,6 @@ static uint32_t fwts_fake_physical_addr(size_t size)
>         return addr;
>  }
>
> -
>  /*
>   *  fwts_acpi_load_table_from_acpidump()
>   *     Load an ACPI table from the output of acpidump or fwts --dump
> @@ -340,8 +339,8 @@ static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
>
>         /*
>          * Parse tablename followed by address, e.g.
> -        *   DSTD @ 0xbfa02344
> -        *   SSDT4 @ 0xbfa0f230
> +        *   DSTD @ 0xbfa02344
> +        *   SSDT4 @ 0xbfa0f230
>          */
>         ptr = strstr(buffer, "@ 0x");
>         if (ptr == NULL)
> @@ -360,7 +359,7 @@ static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
>
>         if (sscanf(ptr, "@ 0x%Lx\n", &table_addr) < 1)
>                 return NULL; /* Can't parse address */
> -
> +
>         *(ptr-1) = '\0';
>         strcpy(name, buffer);
>
> @@ -397,7 +396,6 @@ static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
>         return table;
>  }
>
> -
>  /*
>   *  fwts_acpi_load_tables_from_acpidump()
>   *     Load in all ACPI tables from output of acpidump or fwts --dump
> @@ -413,7 +411,7 @@ static int fwts_acpi_load_tables_from_acpidump(fwts_framework *fw)
>         }
>
>         while (!feof(fp)) {
> -               uint64_t addr;
> +               uint64_t addr;
>                 uint8_t *table;
>                 size_t length;
>                 char name[16];
> @@ -436,7 +434,7 @@ static uint8_t *fwts_acpi_load_table_from_file(const int fd, size_t *length)
>         uint8_t *ptr = NULL;
>         ssize_t n;
>         size_t size = 0;
> -       char buffer[4096];
> +       char buffer[4096];
>
>         *length = 0;
>
> @@ -615,7 +613,7 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
>         /* No XSDT? go and fake one */
>         if (xsdt == NULL) {
>                 size_t size = sizeof(fwts_acpi_table_rsdt) + (count * sizeof(uint64_t));
> -               if ((xsdt = fwts_low_calloc(1, size)) == NULL)
> +               if ((xsdt = fwts_low_calloc(1, size)) == NULL)
>                         return FWTS_ERROR;
>
>                 for (i=0,j=0; j<count ;i++)
> diff --git a/src/lib/src/fwts_acpid.c b/src/lib/src/fwts_acpid.c
> index 6952276..3107052 100644
> --- a/src/lib/src/fwts_acpid.c
> +++ b/src/lib/src/fwts_acpid.c
> @@ -72,7 +72,7 @@ int fwts_acpi_event_open(void)
>  char *fwts_acpi_event_read(const int fd, size_t *length, const int timeout)
>  {
>         char *ptr = NULL;
> -       char buffer[8192];
> +       char buffer[8192];
>         struct timeval tv;
>         fd_set rfds;
>
> diff --git a/src/lib/src/fwts_alloc.c b/src/lib/src/fwts_alloc.c
> index 2657335..4495ad4 100644
> --- a/src/lib/src/fwts_alloc.c
> +++ b/src/lib/src/fwts_alloc.c
> @@ -27,7 +27,7 @@
>   * We implement a low memory allocator to allow us to allocate
>   * memory < 2G limit for the ACPICA table handling.  On 64 bit
>   * machines we habe to ensure that cached copies of ACPI tables
> - * have addresses that can be addressed by the legacy 32 bit
> + * have addresses that can be addressed by the legacy 32 bit
>   * ACPI table pointers.
>   *
>   * This implementation is not intended to be a malloc replacement
> @@ -68,7 +68,7 @@ static void *fwts_low_mmap(const size_t requested_size)
>
>         if ((fp = fopen("/proc/self/maps", "r")) == NULL)
>                 return MAP_FAILED;
> -
> +
>         while (fgets(buffer, sizeof(buffer), fp) != NULL) {
>                 sscanf(buffer, "%p-%p %*s %*x %*s %*u %s",
>                         &addr_start, &addr_end, pathname);
> @@ -77,7 +77,7 @@ static void *fwts_low_mmap(const size_t requested_size)
>                     (last_addr_end < (void*)LIMIT_2GB)) {
>                         if ((addr_start - last_addr_end) > requested_size) {
>                                 void *addr = last_addr_end;
> -                               ret = mmap(addr, requested_size, PROT_READ | PROT_WRITE,
> +                               ret = mmap(addr, requested_size, PROT_READ | PROT_WRITE,
>                                         MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, -1, 0);
>                                 if (ret != MAP_FAILED)
>                                         break;  /* Success! */
> @@ -115,10 +115,10 @@ void *fwts_low_calloc(const size_t nmemb, const size_t size)
>         fwts_mmap_header *hdr;
>
>         n += sizeof(fwts_mmap_header);
> -
> +
>  #ifdef MAP_32BIT
>         /* Not portable, only x86 */
> -       ret = mmap(NULL, n, PROT_READ | PROT_WRITE,
> +       ret = mmap(NULL, n, PROT_READ | PROT_WRITE,
>                 MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
>  #else
>         /* We don't have a native MAP_32BIT, so bodge our own */
> @@ -164,7 +164,7 @@ void *fwts_low_realloc(const void *ptr, const size_t size)
>                 (ptr - sizeof(fwts_mmap_header));
>
>         /* sanity check */
> -       if (hdr->magic != FWTS_ALLOC_MAGIC)
> +       if (hdr->magic != FWTS_ALLOC_MAGIC)
>                 return NULL;
>
>         if ((ret = fwts_low_malloc(size)) == NULL)
> diff --git a/src/lib/src/fwts_args.c b/src/lib/src/fwts_args.c
> index 8c7d487..a0dc5af 100644
> --- a/src/lib/src/fwts_args.c
> +++ b/src/lib/src/fwts_args.c
> @@ -62,7 +62,7 @@ int fwts_args_init(void)
>   *     add a table of options and handler for these options
>   */
>  int fwts_args_add_options(fwts_option *options, fwts_args_optarg_handler handler, fwts_args_optarg_check check)
> -{
> +{
>         int n;
>         fwts_options_table *options_table;
>
> @@ -118,12 +118,12 @@ int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
>                 for (i=0; i<options_table->num_options; i++, n++) {
>                         char *short_name = options_table->options[i].short_name;
>                         size_t len;
> -
> +
>                         long_options[n].name    = options_table->options[i].long_name;
>                         long_options[n].has_arg = options_table->options[i].has_arg;
>                         long_options[n].flag    = 0;
>                         long_options[n].val     = 0;
> -
> +
>                         if (short_name && (len = strlen(short_name)) > 0) {
>                                 if (short_options) {
>                                         short_options = realloc(short_options,
> @@ -165,7 +165,7 @@ int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
>                                         if (index(short_name, c) != NULL) {
>                                                 found = true;
>                                                 break;
> -                                       }
> +                                       }
>                                 }
>                         } else if (options_table->num_options > option_index)
>                                 found = true;
> @@ -187,7 +187,7 @@ int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
>         fwts_list_foreach(item, &options_list) {
>                 options_table = fwts_list_data(fwts_options_table *, item);
>                 if (options_table->optarg_check != NULL) {
> -                       ret = options_table->optarg_check(fw);
> +                       ret = options_table->optarg_check(fw);
>                         if (ret != FWTS_OK)
>                                 break;
>                 }
> @@ -224,7 +224,7 @@ void fwts_args_show_option(int width, char *option, char *explanation)
>         fwts_list *text;
>         fwts_list_link *item;
>         int lineno = 0;
> -
> +
>         text = fwts_format_text(explanation,
>                 width < 0 ? (FWTS_MIN_TTY_WIDTH - FWTS_ARGS_WIDTH-1) : width);
>
> @@ -262,7 +262,7 @@ void fwts_args_show_options(void)
>                 options_table = fwts_list_data(fwts_options_table *, item);
>
>                 for (i=0; i<options_table->num_options; i++) {
> -                       fwts_list_add_ordered(&sorted_options,
> +                       fwts_list_add_ordered(&sorted_options,
>                                 &options_table->options[i], fwts_args_compare_options);
>                 }
>         }
> @@ -302,7 +302,7 @@ void fwts_args_show_options(void)
>  int fwts_args_free(void)
>  {
>         fwts_list_free_items(&options_list, free);
> -
> +
>         return FWTS_OK;
>  }
>
> @@ -319,7 +319,7 @@ char *fwts_args_comma_list(const char *arg)
>         char *retstr = NULL;
>         char *tmparg;
>
> -       if ((tmparg = strdup(arg)) == NULL)
> +       if ((tmparg = strdup(arg)) == NULL)
>                 return NULL;
>
>          for (tmpstr = tmparg; (token = strtok_r(tmpstr, ",", &saveptr)) != NULL; tmpstr = NULL) {
> @@ -333,10 +333,10 @@ char *fwts_args_comma_list(const char *arg)
>                         free(tmparg);
>                         return NULL;
>                 }
> -        }
> +        }
>
>         free(tmparg);
> -
> +
>         /* Any empty list should return an empty string and not NULL */
>         if (retstr == NULL)
>                 retstr = calloc(1, 1);
> diff --git a/src/lib/src/fwts_battery.c b/src/lib/src/fwts_battery.c
> index 423b525..656cc33 100644
> --- a/src/lib/src/fwts_battery.c
> +++ b/src/lib/src/fwts_battery.c
> @@ -81,7 +81,7 @@ static int fwts_battery_get_capacity_sys_fs(fwts_framework *fw,
>                         i++;
>                         if (!match)
>                                 continue;
> -
> +
>                         snprintf(path, sizeof(path), "%s/%s/uevent", FWTS_SYS_CLASS_POWER_SUPPLY, entry->d_name);
>                         if ((fp = fopen(path, "r")) == NULL) {
>                                 fwts_log_info(fw, "Battery %s present but undersupported - no state present.", entry->d_name);
> @@ -233,7 +233,7 @@ static int fwts_battery_get_name_sys_fs(fwts_framework *fw, DIR *dir, int index,
>                         i++;
>                         if (!match)
>                                 continue;
> -
> +
>                         strcpy(name, entry->d_name);
>                         return FWTS_OK;
>                 }
> diff --git a/src/lib/src/fwts_checksum.c b/src/lib/src/fwts_checksum.c
> index 9f2aa8b..10373b7 100644
> --- a/src/lib/src/fwts_checksum.c
> +++ b/src/lib/src/fwts_checksum.c
> @@ -21,7 +21,7 @@
>
>  /*
>   *  fwts_checksum()
> - *     checksum a uint8_t * buffer
> + *     checksum a uint8_t * buffer
>   */
>  uint8_t fwts_checksum(const uint8_t *data, const int length)
>  {
> diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c
> index 094ced5..06df9a7 100644
> --- a/src/lib/src/fwts_cpu.c
> +++ b/src/lib/src/fwts_cpu.c
> @@ -68,7 +68,7 @@ int fwts_cpu_readmsr(const int cpu, const uint32_t reg, uint64_t *val)
>                 if (stat(buffer, &statbuf))
>                         return FWTS_ERROR; /* Really failed */
>         }
> -
> +
>         if ((fd = open(buffer, O_RDONLY)) < 0)
>                  return FWTS_ERROR;
>
> @@ -169,7 +169,7 @@ static int fwts_cpu_matches_vendor_id(const char *vendor_id, bool *matches)
>
>         if ((cpu = fwts_cpu_get_info(0)) == NULL)
>                 return FWTS_ERROR;
> -
> +
>          *matches = (strstr(cpu->vendor_id, vendor_id) != NULL);
>
>         fwts_cpu_free_info(cpu);
> @@ -199,7 +199,7 @@ fwts_bool fwts_cpu_has_c1e(void)
>
>         if ((cpu = fwts_cpu_get_info(0)) == NULL)
>                 return FWTS_BOOL_ERROR;
> -
> +
>          if (strstr(cpu->vendor_id, "AuthenticAMD") == NULL) {
>                 fwts_cpu_free_info(cpu);
>                 return FWTS_FALSE;
> @@ -243,7 +243,7 @@ int fwts_cpu_enumerate(void)
>
>         if (cpus < 0)
>                 return FWTS_ERROR;
> -
> +
>         return cpus;
>  }
>
> @@ -308,7 +308,7 @@ static void fwts_cpu_consume_cycles(void)
>  void fwts_cpu_consume_complete(void)
>  {
>         fwts_cpu_consume_kill();
> -       free(fwts_cpu_pids);
> +       free(fwts_cpu_pids);
>  }
>
>  /*
> @@ -333,7 +333,7 @@ int fwts_cpu_consume_start(void)
>                 pid = fork();
>                 switch (pid) {
>                 case 0: /* Child */
> -                       fwts_cpu_consume_cycles();
> +                       fwts_cpu_consume_cycles();
>                         break;
>                 case -1:
>                         /* Went wrong */
> diff --git a/src/lib/src/fwts_dump.c b/src/lib/src/fwts_dump.c
> index b684d8f..f14e8f9 100644
> --- a/src/lib/src/fwts_dump.c
> +++ b/src/lib/src/fwts_dump.c
> @@ -34,7 +34,6 @@
>   *  Utilities for the fwts --dump option
>   */
>
> -
>  /*
>   *  dump_data()
>   *     dump to path/filename a chunk of data of length len
> @@ -106,7 +105,7 @@ static int dump_exec(const char *path, const char *filename, const char *command
>         }
>
>         fwts_pipe_close(fd, pid);
> -
> +
>         ret = dump_data(path, filename, data, len);
>
>         free(data);
> @@ -132,7 +131,7 @@ static int dump_dmidecode(fwts_framework *fw, const char *path, const char *file
>  static int dump_lspci(fwts_framework *fw, const char *path, const char *filename)
>  {
>         char command[1024];
> -
> +
>         snprintf(command, sizeof(command), "%s -vv -nn", fw->lspci);
>
>         return dump_exec(path, filename, command);
> @@ -188,7 +187,7 @@ static int dump_acpi_tables(fwts_framework *fw, const char *path)
>                 dump_acpi_table(table, fp);
>         }
>         fclose(fp);
> -
> +
>         return FWTS_OK;
>  }
>  #endif
> @@ -228,7 +227,7 @@ static int dump_readme(const char *path)
>         }
>
>         fclose(fp);
> -
> +
>         return FWTS_OK;
>  }
>
> @@ -249,7 +248,7 @@ int fwts_dump_info(fwts_framework *fw, const char *path)
>
>         if (access(path, F_OK) != 0)
>                 mkdir(path, 0777);
> -
> +
>
>         if (dump_readme(path) != FWTS_OK)
>                 fprintf(stderr, "Failed to dump README.txt.\n");
> diff --git a/src/lib/src/fwts_formatting.c b/src/lib/src/fwts_formatting.c
> index b7ef6b4..a68204a 100644
> --- a/src/lib/src/fwts_formatting.c
> +++ b/src/lib/src/fwts_formatting.c
> @@ -101,7 +101,7 @@ fwts_list *fwts_format_text(const char *text, const int width)
>                 fwts_list_free(list, free);
>                 return NULL;
>         }
> -
> +
>         linestart = tidied_text;
>
>         while (*textptr) {
> @@ -121,7 +121,7 @@ fwts_list *fwts_format_text(const char *text, const int width)
>                                 }
>                                 fwts_text_list_append(list, tmp);
>                                 free(tmp);
> -
> +
>                                 linestart = lastspace + ((isspace(*lastspace)) ? 1 : 0);
>                                 linelen = textptr - linestart;
>                                 lastspace = NULL;
> @@ -137,6 +137,6 @@ fwts_list *fwts_format_text(const char *text, const int width)
>         fwts_text_list_append(list, tmp);
>         free(tmp);
>         free(tidied_text);
> -
> +
>         return list;
>  }
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index f53bbf2..c6536a6 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -92,7 +92,7 @@ typedef struct {
>
>  static const char *fwts_copyright[] = {
>         "Some of this work - Copyright (c) 1999 - 2010, Intel Corp. All rights reserved.",
> -       "Some of this work - Copyright (c) 2010 - 2012, Canonical.",
> +       "Some of this work - Copyright (c) 2010 - 2012, Canonical.",
>         NULL
>  };
>
> @@ -191,14 +191,14 @@ static void fwts_framework_show_tests_brief(fwts_framework *fw)
>                         fwts_framework_compare_test_name);
>         }
>
> -       fwts_list_foreach(item, &sorted) {
> +       fwts_list_foreach(item, &sorted) {
>                 fwts_framework_test *test = fwts_list_data(fwts_framework_test*, item);
>                 int len = strlen(test->name) + 1;
>                 if ((n + len) > width)  {
>                         fprintf(stderr, "\n");
>                         n = 0;
>                 }
> -
> +
>                 fprintf(stderr, "%s ", test->name);
>                 n += len;
>         }
> @@ -255,7 +255,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, bool full)
>                                 need_nl = 1;
>                                 printf("%s%s:\n", categories[i].title,
>                                         categories[i].flag & FWTS_UTILS ? "" : " tests");
> -
> +
>                                 fwts_list_foreach(item, &sorted) {
>                                         test = fwts_list_data(fwts_framework_test *, item);
>                                         if (full) {
> @@ -268,7 +268,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, bool full)
>                                                 total += test->ops->total_tests;
>                                         }
>                                         else {
> -                                               printf(" %-13.13s %s\n", test->name,
> +                                               printf(" %-13.13s %s\n", test->name,
>                                                         test->ops->description ? test->ops->description : "");
>                                         }
>                                 }
> @@ -392,7 +392,7 @@ void fwts_framework_minor_test_progress(fwts_framework *fw, const int percent, c
>                 fprintf(stdout, "XXX\n");
>                 fprintf(stdout, "%d\n", (int)progress);
>                 fprintf(stdout, "So far: %s\n\n", buffer);
> -               fprintf(stdout, "%s\n\n", fw->current_major_test->ops->description ?
> +               fprintf(stdout, "%s\n\n", fw->current_major_test->ops->description ?
>                         fw->current_major_test->ops->description : "");
>                 fprintf(stdout, "Running test #%d: %s\n",
>                         fw->current_major_test_num,
> @@ -462,8 +462,8 @@ static int fwts_framework_total_summary(fwts_framework *fw)
>  }
>
>  static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts_framework_test *test)
> -{
> -       fwts_framework_minor_test *minor_test;
> +{
> +       fwts_framework_minor_test *minor_test;
>         int ret;
>
>         fw->current_major_test = test;
> @@ -512,7 +512,7 @@ static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts
>                 goto done;
>         }
>
> -       if ((test->ops->init) &&
> +       if ((test->ops->init) &&
>             ((ret = test->ops->init(fw)) != FWTS_OK)) {
>                 char *msg = NULL;
>
> @@ -535,8 +535,8 @@ static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts
>         }
>
>         fwts_log_section_begin(fw->results, "subtests");
> -       for (minor_test = test->ops->minor_tests;
> -               *minor_test->test_func != NULL;
> +       for (minor_test = test->ops->minor_tests;
> +               *minor_test->test_func != NULL;
>                 minor_test++, fw->current_minor_test_num++) {
>
>                 fwts_log_section_begin(fw->results, "subtest");
> @@ -613,7 +613,7 @@ done:
>
>  /*
>   *  fwts_framework_tests_run()
> - *
> + *
>   */
>  static void fwts_framework_tests_run(fwts_framework *fw, fwts_list *tests_to_run)
>  {
> @@ -636,7 +636,7 @@ static void fwts_framework_tests_run(fwts_framework *fw, fwts_list *tests_to_run
>  static fwts_framework_test *fwts_framework_test_find(fwts_framework *fw, const char *name)
>  {
>         fwts_list_link *item;
> -
> +
>         fwts_list_foreach(item, &fwts_framework_test_list) {
>                 fwts_framework_test *test = fwts_list_data(fwts_framework_test *, item);
>                 if (strcmp(name, test->name) == 0)
> @@ -667,7 +667,7 @@ void fwts_framework_log(fwts_framework *fw,
>                 va_start(ap, fmt);
>                 vsnprintf(buffer, sizeof(buffer), fmt, ap);
>                 va_end(ap);
> -       } else
> +       } else
>                 *buffer = '\0';
>
>         if (count)
> @@ -737,10 +737,10 @@ static void fwts_framework_syntax(char * const *argv)
>         printf("Usage %s: [OPTION] [TEST]\n", argv[0]);
>
>         fwts_args_show_options();
> -
> +
>         /* Tag on copyright info */
>         printf("\n");
> -       for (i=0; fwts_copyright[i]; i++)
> +       for (i=0; fwts_copyright[i]; i++)
>                 printf("%s\n", fwts_copyright[i]);
>  }
>
> @@ -774,7 +774,7 @@ static void fwts_framework_heading_info(fwts_framework *fw, fwts_list *tests_to_
>                 tm.tm_hour, tm.tm_min, tm.tm_sec,
>                 buf.sysname, buf.nodename, buf.release, buf.version, buf.machine);
>         fwts_log_nl(fw);
> -
> +
>         fwts_list_foreach(item, tests_to_run) {
>                 fwts_framework_test *test = fwts_list_data(fwts_framework_test *, item);
>                 len += strlen(test->name) + 1;
> @@ -873,7 +873,7 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
>                 switch (long_index) {
>                 case 0: /* --stdout-summary */
>                         fw->flags |= FWTS_FRAMEWORK_FLAGS_STDOUT_SUMMARY;
> -                       break;
> +                       break;
>                 case 1: /* --help */
>                         fwts_framework_syntax(argv);
>                         return FWTS_COMPLETE;
> @@ -892,7 +892,7 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
>                         return FWTS_COMPLETE;
>                 case 6: /* --log-format */
>                         fwts_log_set_format(optarg);
> -                       break;
> +                       break;
>                 case 7: /* --show-progress */
>                         fw->flags = (fw->flags &
>                                         ~(FWTS_FRAMEWORK_FLAGS_QUIET |
> @@ -1147,7 +1147,7 @@ int fwts_framework_args(const int argc, char **argv)
>
>         /* Results log */
>         if ((fw->results = fwts_log_open("fwts",
> -                       fw->results_logname,
> +                       fw->results_logname,
>                         fw->flags & FWTS_FRAMEWORK_FLAGS_FORCE_CLEAN ? "w" : "a",
>                         fw->log_type)) == NULL) {
>                 ret = FWTS_ERROR;
> @@ -1186,7 +1186,7 @@ int fwts_framework_args(const int argc, char **argv)
>
>         if (!(fw->flags & FWTS_FRAMEWORK_FLAGS_QUIET)) {
>                 char *filenames = fwts_log_get_filenames(fw->results_logname, fw->log_type);
> -
> +
>                 if (filenames) {
>                         printf("Running %d tests, results appended to %s\n",
>                                 fwts_list_len(&tests_to_run),
> @@ -1236,10 +1236,10 @@ tidy_close:
>         fwts_list_free_items(&fwts_framework_test_list, free);
>
>         /* Failed tests flagged an error */
> -       if ((fw->total.failed > 0) || (fw->total.warning > 0))
> +       if ((fw->total.failed > 0) || (fw->total.warning > 0))
>                 ret = FWTS_ERROR;
>
>         free(fw);
> -
> +
>         return ret;
>  }
> diff --git a/src/lib/src/fwts_get.c b/src/lib/src/fwts_get.c
> index 107e3c7..be56eca 100644
> --- a/src/lib/src/fwts_get.c
> +++ b/src/lib/src/fwts_get.c
> @@ -23,26 +23,25 @@
>
>  #include "fwts.h"
>
> -
>  /*
>   *  fwts_get()
>   *     get a string from a file. used to gather text from /proc or /sys entries
>   */
>  char *fwts_get(const char *file)
> -{
> +{
>         FILE *fp;
>         char buffer[4096];
>
>         if ((fp = fopen(file, "r")) == NULL)
>                 return NULL;
> -
> +
>         if (fgets(buffer, sizeof(buffer), fp) == NULL) {
>                 fclose(fp);
>                 return NULL;
>         }
>
>         fclose(fp);
> -
> +
>         return strdup(buffer);
>  }
>
> @@ -55,7 +54,7 @@ int fwts_get_int(const char *file, int *value)
>         char *data;
>
>         *value = 0;
> -
> +
>         if ((data = fwts_get(file)) == NULL) {
>                 *value = 0;
>                 return FWTS_ERROR;
> diff --git a/src/lib/src/fwts_gpe.c b/src/lib/src/fwts_gpe.c
> index 00b058b..df7ba2a 100644
> --- a/src/lib/src/fwts_gpe.c
> +++ b/src/lib/src/fwts_gpe.c
> @@ -58,7 +58,7 @@ int fwts_gpe_read(fwts_gpe **gpes)
>
>         if ((dir = opendir(FWTS_GPE_PATH)) == NULL)
>                 return FWTS_ERROR;
> -
> +
>         while ((entry = readdir(dir)) != NULL) {
>                 if ((strncmp(entry->d_name, "gpe", 3) == 0) ||
>                     (strncmp(entry->d_name, "sci",3) == 0)) {
> @@ -70,7 +70,7 @@ int fwts_gpe_read(fwts_gpe **gpes)
>
>                                 if (((*gpes)[n].name  = strdup(entry->d_name)) == NULL)
>                                         goto error;
> -
> +
>                                 snprintf(path, sizeof(path), "%s/%s", FWTS_GPE_PATH, entry->d_name);
>                                 if ((data = fwts_get(path)) != NULL) {
>                                         (*gpes)[n].count = atoi(data);
> @@ -99,7 +99,7 @@ error:
>   *     update the result in gpe_delta.
>   */
>  int fwts_gpe_delta(int **gpe_delta, const fwts_gpe *start, const fwts_gpe *end, const int n)
> -{
> +{
>         int i;
>         if (((*gpe_delta) = calloc(n, sizeof(int))) == NULL)
>                 return FWTS_ERROR;
> @@ -162,7 +162,7 @@ void fwts_gpe_test(fwts_framework *fw, const fwts_gpe *gpes_start, const fwts_gp
>                 }
>         }
>         free(deltas);
> -
> +
>         if (sci == 0)
>                 fwts_failed(fw, LOG_LEVEL_HIGH, "NoSCIInterrupts", "Did not detect any SCI interrupts.");
>
> diff --git a/src/lib/src/fwts_guid.c b/src/lib/src/fwts_guid.c
> index a532170..510cb25 100644
> --- a/src/lib/src/fwts_guid.c
> +++ b/src/lib/src/fwts_guid.c
> @@ -28,7 +28,7 @@
>   */
>  void fwts_guid_buf_to_str(uint8_t *guid, char *guid_str, size_t guid_str_len)
>  {
> -       if (guid_str && guid_str_len > 36)
> +       if (guid_str && guid_str_len > 36)
>                 snprintf(guid_str, guid_str_len, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
>                         guid[3], guid[2], guid[1], guid[0], guid[5], guid[4], guid[7], guid[6],
>                         guid[8], guid[9], guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]);
> diff --git a/src/lib/src/fwts_hwinfo.c b/src/lib/src/fwts_hwinfo.c
> index 86d014e..b540b98 100644
> --- a/src/lib/src/fwts_hwinfo.c
> +++ b/src/lib/src/fwts_hwinfo.c
> @@ -23,7 +23,7 @@
>
>  /*
>   *  fwts_hwinfo_get()
> - *     gather H/W information
> + *     gather H/W information
>   */
>  int fwts_hwinfo_get(fwts_framework *fw, fwts_hwinfo *hwinfo)
>  {
> diff --git a/src/lib/src/fwts_iasl.c b/src/lib/src/fwts_iasl.c
> index 736a4e3..9b3b873 100644
> --- a/src/lib/src/fwts_iasl.c
> +++ b/src/lib/src/fwts_iasl.c
> @@ -52,7 +52,7 @@ static int fwts_iasl_dump_aml_to_file(fwts_framework *fw,
>                 close(fd);
>                 (void)unlink(amlfile);
>                 return FWTS_ERROR;
> -       }
> +       }
>         close(fd);
>
>         return FWTS_OK;
> @@ -166,7 +166,7 @@ int fwts_iasl_disassemble_all_to_file(fwts_framework *fw)
>   *     any re-assembly errors into list iasl_errors.
>   */
>  int fwts_iasl_reassemble(fwts_framework *fw,
> -       const uint8_t *data,
> +       const uint8_t *data,
>         const int len,
>         fwts_list **iasl_disassembly,
>         fwts_list **iasl_errors)
> diff --git a/src/lib/src/fwts_interactive.c b/src/lib/src/fwts_interactive.c
> index 2b424b5..07d3f39 100644
> --- a/src/lib/src/fwts_interactive.c
> +++ b/src/lib/src/fwts_interactive.c
> @@ -37,7 +37,7 @@ static int fwts_getchar(int *ch)
>
>         *ch = -1;
>
> -       if (tcgetattr(fd, &oldterm) < 0)
> +       if (tcgetattr(fd, &oldterm) < 0)
>                 return FWTS_ERROR;
>
>         memcpy(&newterm, &oldterm, sizeof(struct termios));
> @@ -49,8 +49,8 @@ static int fwts_getchar(int *ch)
>                 return FWTS_ERROR;
>
>         *ch = getchar();
> -
> -       if (tcsetattr(fd, TCSANOW, &oldterm) < 0)
> +
> +       if (tcsetattr(fd, TCSANOW, &oldterm) < 0)
>                 return FWTS_ERROR;
>
>         return FWTS_OK;
> @@ -83,7 +83,7 @@ int fwts_press_enter(fwts_framework *fw)
>
>         fprintf(stdout, "Press <Enter> to continue");
>         fflush(stdout);
> -
> +
>         do {
>                 if (fwts_getchar(&ch) == FWTS_ERROR) {
>                         fwts_log_error(fw, "fwts_getchar() failed.");
> @@ -93,7 +93,7 @@ int fwts_press_enter(fwts_framework *fw)
>
>         fprintf(stdout, "\n");
>         fflush(stdout);
> -
> +
>         return FWTS_OK;
>  }
>
> @@ -111,7 +111,7 @@ int fwts_get_reply(fwts_framework *fw, const char *message, const char *options)
>         for (;;) {
>
>                 if (fwts_getchar(&ch) == FWTS_ERROR) {
> -                       fwts_log_error(fw, "fwts_getchar() failed.");
> +                       fwts_log_error(fw, "fwts_getchar() failed.");
>                         break;
>                 }
>                 if (index(options, ch) != NULL)
> diff --git a/src/lib/src/fwts_keymap.c b/src/lib/src/fwts_keymap.c
> index 10c5e3b..b60c331 100644
> --- a/src/lib/src/fwts_keymap.c
> +++ b/src/lib/src/fwts_keymap.c
> @@ -51,7 +51,7 @@ void fwts_keymap_free(fwts_list *keylist)
>   *     in a list of keymap items.
>   */
>  fwts_list *fwts_keymap_load(const char *machine)
> -{
> +{
>         FILE *fp;
>         char buffer[4096];
>         char path[PATH_MAX];
> @@ -59,7 +59,7 @@ fwts_list *fwts_keymap_load(const char *machine)
>
>         if ((keymap_list = fwts_list_new()) == NULL)
>                 return NULL;
> -
> +
>         snprintf(path, sizeof(path), "%s/%s", FWTS_KEYMAP_PATH, machine);
>
>         if ((fp = fopen(path, "r")) == NULL)
> @@ -116,7 +116,7 @@ fwts_list *fwts_keymap_load(const char *machine)
>         }
>
>         fclose(fp);
> -
> +
>         return keymap_list;
>  }
>
> diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
> index 7b7fb41..93dbb06 100644
> --- a/src/lib/src/fwts_klog.c
> +++ b/src/lib/src/fwts_klog.c
> @@ -68,7 +68,7 @@ fwts_list *fwts_klog_read(void)
>
>         if ((buffer = calloc(1, len)) == NULL)
>                 return NULL;
> -
> +
>         if (klogctl(3, buffer, len) < 0) {
>                 free(buffer);
>                 return NULL;
> @@ -76,7 +76,7 @@ fwts_list *fwts_klog_read(void)
>
>         list = fwts_list_from_text(buffer);
>         free(buffer);
> -
> +
>         return list;
>  }
>
> @@ -131,10 +131,10 @@ int fwts_klog_scan(fwts_framework *fw,
>                 if (*newline) {
>                         int matched = 0;
>                         fwts_list_link *l;
> -                       fwts_list_foreach(l, klog_reduced) {
> +                       fwts_list_foreach(l, klog_reduced) {
>                                 char *line;
>                                 klog_reduced_item *reduced = fwts_list_data(klog_reduced_item *, l);
> -
> +
>                                 line = fwts_klog_remove_timestamp(reduced->line);
>                                 if (strcmp(newline, line) == 0) {
>                                         reduced->repeated++;
> @@ -144,7 +144,7 @@ int fwts_klog_scan(fwts_framework *fw,
>                         }
>                         if (!matched) {
>                                 klog_reduced_item *new;
> -
> +
>                                 if ((new = calloc(1, sizeof(klog_reduced_item))) == NULL) {
>                                         fwts_list_free(klog_reduced, free);
>                                         return FWTS_ERROR;
> @@ -272,7 +272,7 @@ static fwts_compare_mode fwts_klog_compare_mode_str_to_val(const char *str)
>         else
>                 return FWTS_COMPARE_UNKNOWN;
>  }
> -
> +
>  #define JSON_ERROR     ((json_object*)-1)
>
>  /*
> @@ -311,12 +311,12 @@ static int fwts_klog_check(fwts_framework *fw,
>                 fwts_log_error(fw, "Cannot load klog data from %s.", json_data_path);
>                 return FWTS_ERROR;
>         }
> -
> +
>         if ((klog_table = json_object_object_get(klog_objs, table)) == JSON_ERROR) {
>                 fwts_log_error(fw, "Cannot fetch klog table object '%s' from %s.", table, json_data_path);
>                 goto fail_put;
>         }
> -
> +
>         n = json_object_array_length(klog_table);
>
>         /* Last entry is null to indicate end, so alloc n+1 items */
> @@ -367,13 +367,13 @@ fail:
>         free(patterns);
>  fail_put:
>         json_object_put(klog_objs);
> -
> +
>         return ret;
>  }
>
>  int fwts_klog_firmware_check(fwts_framework *fw, fwts_klog_progress_func progress,
>         fwts_list *klog, int *errors)
> -{
> +{
>         return fwts_klog_check(fw, "firmware_error_warning_patterns",
>                 progress, klog, errors);
>  }
> diff --git a/src/lib/src/fwts_log.c b/src/lib/src/fwts_log.c
> index 55ebd06..6ed32c1 100644
> --- a/src/lib/src/fwts_log.c
> +++ b/src/lib/src/fwts_log.c
> @@ -219,7 +219,6 @@ void fwts_log_print_fields(void)
>         printf("\n");
>  }
>
> -
>  /*
>   *  fwts_log_str_to_field()
>   *     return log field of a given string, 0 if not matching
> diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
> index a0ca16f..8b29315 100644
> --- a/src/lib/src/fwts_memorymap.c
> +++ b/src/lib/src/fwts_memorymap.c
> @@ -100,7 +100,7 @@ static int fwts_register_memory_map_line(fwts_list *memory_map_list, const uint6
>
>         if ((entry = calloc(1, sizeof(fwts_memory_map_entry))) == NULL)
>                 return FWTS_ERROR;
> -
> +
>         entry->start_address = start;
>         entry->end_address   = end;
>         entry->type          = type;
> @@ -153,7 +153,7 @@ fwts_bool fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_t
>         /* when we don't have FWTS_MEMORY_MAP info, assume all is fair */
>         if (memory_map_list == NULL)
>                 return FWTS_TRUE;
> -
> +
>         /* bios data area is always reserved */
>         if ((memory >= 640 * 1024) && (memory <= 1024*1024))
>                 return FWTS_TRUE;
> @@ -233,7 +233,7 @@ fwts_list *fwts_memory_map_table_load_from_klog(fwts_framework *fw)
>
>         if ((memory_map_list = fwts_list_new()) == NULL)
>                 return NULL;
> -
> +
>         fwts_list_iterate(klog, fwts_memory_map_dmesg_info, memory_map_list);
>         fwts_klog_free(klog);
>
> @@ -268,7 +268,7 @@ static fwts_memory_map_entry *fwts_memory_map_table_read_entry(const char *which
>         }
>         sscanf(data, "0x%llx", (unsigned long long*)&entry->end_address);
>         free(data);
> -
> +
>         snprintf(path, sizeof(path), "/sys/firmware/memmap/%s/type", which);
>         if ((data = fwts_get(path)) == NULL) {
>                 free(entry);
> diff --git a/src/lib/src/fwts_microcode.c b/src/lib/src/fwts_microcode.c
> index b3784ef..209cf29 100644
> --- a/src/lib/src/fwts_microcode.c
> +++ b/src/lib/src/fwts_microcode.c
> @@ -110,7 +110,7 @@ int fwts_update_microcode(fwts_framework *fw, const char *device, const char *fi
>                 return FWTS_ERROR;
>         }
>
> -       close(fd);
> +       close(fd);
>         free(microcode);
>
>         return FWTS_OK;
> diff --git a/src/lib/src/fwts_multiproc.c b/src/lib/src/fwts_multiproc.c
> index 693ff5a..01f4561 100644
> --- a/src/lib/src/fwts_multiproc.c
> +++ b/src/lib/src/fwts_multiproc.c
> @@ -79,7 +79,7 @@ static int fwts_mp_get_address(uint32_t *phys_addr)
>                         continue;
>
>                 for (ptr = mem; ptr < (uint8_t*)(mem + size); ptr+=16) {
> -                       if ((*ptr == '_') &&
> +                       if ((*ptr == '_') &&
>                             (*(ptr + 1) == 'M') &&
>                             (*(ptr + 2) == 'P') &&
>                             (*(ptr + 3) == '_')) {
> @@ -100,7 +100,7 @@ static int fwts_mp_get_address(uint32_t *phys_addr)
>         return FWTS_ERROR;
>  }
>
> -/*
> +/*
>   *  fwts_mp_data_get()
>   *     find _MP_ data, map in header and table,
>   *     collect up entries into a list
> @@ -128,7 +128,7 @@ int fwts_mp_data_get(fwts_mp_data *data)
>         header = (fwts_mp_config_table_header *)mem;
>         fwts_list_init(&data->entries);
>
> -       data->size = header->base_table_length +
> +       data->size = header->base_table_length +
>                 ((header->spec_rev == 1) ? 0 : header->extended_table_length);
>
>         /* Remap with full header and table now we know how big it is */
> @@ -185,7 +185,7 @@ int fwts_mp_data_get(fwts_mp_data *data)
>
>  /*
>   *  fwts_mp_data_free()
> - *     free entries and unmap
> + *     free entries and unmap
>   */
>  int fwts_mp_data_free(fwts_mp_data *data)
>  {
> diff --git a/src/lib/src/fwts_oops.c b/src/lib/src/fwts_oops.c
> index df9c3c7..fe557e5 100644
> --- a/src/lib/src/fwts_oops.c
> +++ b/src/lib/src/fwts_oops.c
> @@ -54,7 +54,7 @@ void fwts_oops_dump(fwts_framework *fw, fwts_list_link *bug_item, int *oopses)
>                         dumpable |= FWTS_OOPS_GOT_STACK;
>                 if (strstr(line, "Call Trace:"))
>                         dumpable |= FWTS_OOPS_GOT_CALL_TRACE;
> -               if (strstr(line, "--[ end trace")) {
> +               if (strstr(line, "--[ end trace")) {
>                         dumpable |= FWTS_OOPS_GOT_END_TRACE;
>                         break;
>                 }
> @@ -80,7 +80,7 @@ void fwts_oops_dump(fwts_framework *fw, fwts_list_link *bug_item, int *oopses)
>                 fwts_log_info(fw, "Found OOPS (%d):", *oopses);
>
>                 while (bug_item != NULL && bug_item != item) {
> -                       fwts_log_info_verbatum(fw, "  %s",
> +                       fwts_log_info_verbatum(fw, "  %s",
>                                 fwts_klog_remove_timestamp(fwts_list_data(char *, bug_item)));
>                         bug_item = bug_item->next;
>                 }
> diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
> index d4abfd5..cb6bd1e 100644
> --- a/src/lib/src/fwts_pipeio.c
> +++ b/src/lib/src/fwts_pipeio.c
> @@ -41,7 +41,7 @@ int fwts_pipe_open(const char *command, pid_t *childpid)
>  {
>         int pipefds[2];
>         pid_t pid;
> -
> +
>         if (pipe(pipefds) < 0)
>                 return -1;
>
> @@ -68,7 +68,7 @@ int fwts_pipe_open(const char *command, pid_t *childpid)
>                 /* Parent */
>                 close(pipefds[1]);
>                 *childpid = pid;
> -
> +
>                 return pipefds[0];
>         }
>  }
> @@ -82,7 +82,7 @@ int fwts_pipe_open(const char *command, pid_t *childpid)
>  char *fwts_pipe_read(const int fd, ssize_t *length)
>  {
>         char *ptr = NULL;
> -       char buffer[8192];
> +       char buffer[8192];
>         ssize_t n;
>         ssize_t size = 0;
>         *length = 0;
> diff --git a/src/lib/src/fwts_set.c b/src/lib/src/fwts_set.c
> index 657d25c..e4b0e0c 100644
> --- a/src/lib/src/fwts_set.c
> +++ b/src/lib/src/fwts_set.c
> @@ -28,14 +28,14 @@
>   *     values in /sys or /proc
>   */
>  int fwts_set(const char *text, const char *file)
> -{
> +{
>         FILE *fp;
>
>         if ((fp = fopen(file, "w")) == NULL)
>                 return FWTS_ERROR;
>
>         fprintf(fp, "%s\n", text);
> -       fclose(fp);
> +       fclose(fp);
>
>         return FWTS_OK;
>  }
> diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
> index ef6d076..b9c4540 100644
> --- a/src/lib/src/fwts_smbios.c
> +++ b/src/lib/src/fwts_smbios.c
> @@ -35,7 +35,7 @@ static void *fwts_smbios_find_entry_uefi(fwts_framework *fw, fwts_smbios_entry *
>                         return NULL;
>                 }
>                 *entry = *mapped_entry;
> -               *type  = FWTS_SMBIOS;
> +               *type  = FWTS_SMBIOS;
>                 (void)fwts_munmap(mapped_entry, sizeof(fwts_smbios_entry));
>         }
>         return addr;
> @@ -61,19 +61,19 @@ static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
>                 if ((*(mem+i)   == '_') &&
>                     (*(mem+i+1) == 'S') &&
>                     (*(mem+i+2) == 'M') &&
> -                   (*(mem+i+3) == '_') &&
> +                   (*(mem+i+3) == '_') &&
>                     (fwts_checksum(mem + i, 16) == 0)) {
>                         addr = (void*)FWTS_SMBIOS_REGION_START + i;
>                         memcpy(entry, (void*)(mem + i), sizeof(fwts_smbios_entry));
> -                       *type  = FWTS_SMBIOS;
> +                       *type  = FWTS_SMBIOS;
>                         break;
>                 }
>                 /* Legacy DMI entry point */
>                 if ((*(mem+i)   == '_') &&
>                     (*(mem+i+1) == 'D') &&
>                     (*(mem+i+2) == 'M') &&
> -                   (*(mem+i+3) == 'I') &&
> -                   (*(mem+i+4) == '_') &&
> +                   (*(mem+i+3) == 'I') &&
> +                   (*(mem+i+4) == '_') &&
>                     (fwts_checksum(mem + i, 15) == 0)) {
>                         memset(entry, 0, 16);
>                         addr = (void*)FWTS_SMBIOS_REGION_START + i;
> @@ -82,7 +82,6 @@ static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
>                         break;
>                 }
>         }
> -
>
>          (void)fwts_munmap(mem, FWTS_SMBIOS_REGION_SIZE);
>
> @@ -91,7 +90,7 @@ static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
>
>  /*
>   *  fwts_smbios_find_entry()
> - *     find SMBIOS structure table entry
> + *     find SMBIOS structure table entry
>   */
>  void *fwts_smbios_find_entry(fwts_framework *fw,
>         fwts_smbios_entry *entry,
> @@ -119,7 +118,6 @@ void *fwts_smbios_find_entry(fwts_framework *fw,
>                                 break;
>                         }
>                 }
> -
>         }
>         return addr;
>  }
> diff --git a/src/lib/src/fwts_tag.c b/src/lib/src/fwts_tag.c
> index 38d1449..d8e9dad 100644
> --- a/src/lib/src/fwts_tag.c
> +++ b/src/lib/src/fwts_tag.c
> @@ -82,7 +82,6 @@ static fwts_tag_info fwts_tags[] = {
>         { 0, NULL, NULL }
>  };
>
> -
>  /*
>   *  fwts_tag_id_str_to_tag()
>   *     given a tag string, return the tag
> diff --git a/src/lib/src/fwts_text_list.c b/src/lib/src/fwts_text_list.c
> index 373fe19..4e02f0e 100644
> --- a/src/lib/src/fwts_text_list.c
> +++ b/src/lib/src/fwts_text_list.c
> @@ -115,6 +115,6 @@ fwts_list *fwts_list_from_text(const char *text)
>
>                 fwts_list_append(list, str);
>         }
> -
> +
>         return list;
>  }
> diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
> index 9a125f5..d4f68f4 100644
> --- a/src/lib/src/fwts_uefi.c
> +++ b/src/lib/src/fwts_uefi.c
> @@ -27,7 +27,6 @@
>  #include "fwts.h"
>  #include "fwts_uefi.h"
>
> -
>  static inline void fwts_uefi_set_filename(char *filename, const int len, const char *varname)
>  {
>         snprintf(filename, len, "/sys/firmware/efi/vars/%s/raw_var", varname);
> @@ -42,7 +41,7 @@ void fwts_uefi_str16_to_str(char *dst, const size_t len, const uint16_t *src)
>         size_t i = len;
>
>         while ((*src) && (i > 1)) {
> -               *dst++ = *(src++) & 0xff;
> +               *dst++ = *(src++) & 0xff;
>                 i--;
>         }
>         *dst = '\0';
> @@ -86,7 +85,7 @@ int fwts_uefi_get_variable(const char *varname, fwts_uefi_var *var)
>
>         fwts_uefi_set_filename(filename, sizeof(filename), varname);
>
> -       if ((fd = open(filename, O_RDONLY)) < 0)
> +       if ((fd = open(filename, O_RDONLY)) < 0)
>                 return FWTS_ERROR;
>
>         memset(var, 0, sizeof(fwts_uefi_var));
> @@ -115,7 +114,7 @@ int fwts_uefi_set_variable(const char *varname, fwts_uefi_var *var)
>
>         fwts_uefi_set_filename(filename, sizeof(filename), varname);
>
> -       if ((fd = open(filename, O_WRONLY)) < 0)
> +       if ((fd = open(filename, O_WRONLY)) < 0)
>                 return FWTS_ERROR;
>
>         if ((n = write(fd, var, sizeof(fwts_uefi_var))) != sizeof(fwts_uefi_var))
> diff --git a/src/lib/src/fwts_virt.c b/src/lib/src/fwts_virt.c
> index 22ebc79..ad5bec0 100644
> --- a/src/lib/src/fwts_virt.c
> +++ b/src/lib/src/fwts_virt.c
> @@ -59,7 +59,7 @@ void fwts_exec_cpuid(const int cpu, const uint32_t cmd, cpu_registers* regs)
>                            : "a"(cmd)
>         );
>  #endif
> -
> +
>         if (cpu != CURRENT_CPU)
>                 sched_setaffinity(0, sizeof(oldmask), &oldmask);
>  }
> diff --git a/src/lib/src/fwts_wakealarm.c b/src/lib/src/fwts_wakealarm.c
> index 56d4317..a93e34a 100644
> --- a/src/lib/src/fwts_wakealarm.c
> +++ b/src/lib/src/fwts_wakealarm.c
> @@ -41,14 +41,14 @@ int fwts_wakealarm_get_irq_state(void)
>         if ((fp = fopen("/proc/driver/rtc", "r")) == NULL)
>                 return FWTS_ERROR;
>
> -       while (fscanf(fp, "%s : %s\n", field, value) != EOF) {
> +       while (fscanf(fp, "%s : %s\n", field, value) != EOF) {
>                 if (!strcmp(field, "alarm_IRQ")) {
>                         fclose(fp);
>                         return strcmp(value, "no");
>                 }
>         }
>         fclose(fp);
> -
> +
>         return FWTS_ERROR;
>  }
>
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - July 4, 2012, 10:53 a.m.
On 06/28/2012 08:49 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> After many iterations of changes we've managed to pick up a load
> of trailing white spaces (space, tabs) at the end of lines and
> also a bunch of extraneous empty lines, so tidy this up.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_acpi.c        |    1 -
>   src/lib/src/fwts_acpi_method.c |    7 ++----
>   src/lib/src/fwts_acpi_tables.c |   18 +++++++---------
>   src/lib/src/fwts_acpid.c       |    2 +-
>   src/lib/src/fwts_alloc.c       |   12 +++++------
>   src/lib/src/fwts_args.c        |   22 +++++++++----------
>   src/lib/src/fwts_battery.c     |    4 ++--
>   src/lib/src/fwts_checksum.c    |    2 +-
>   src/lib/src/fwts_cpu.c         |   12 +++++------
>   src/lib/src/fwts_dump.c        |   11 +++++-----
>   src/lib/src/fwts_formatting.c  |    6 +++---
>   src/lib/src/fwts_framework.c   |   46 ++++++++++++++++++++--------------------
>   src/lib/src/fwts_get.c         |    9 ++++----
>   src/lib/src/fwts_gpe.c         |    8 +++----
>   src/lib/src/fwts_guid.c        |    2 +-
>   src/lib/src/fwts_hwinfo.c      |    2 +-
>   src/lib/src/fwts_iasl.c        |    4 ++--
>   src/lib/src/fwts_interactive.c |   12 +++++------
>   src/lib/src/fwts_keymap.c      |    6 +++---
>   src/lib/src/fwts_klog.c        |   20 ++++++++---------
>   src/lib/src/fwts_log.c         |    1 -
>   src/lib/src/fwts_memorymap.c   |    8 +++----
>   src/lib/src/fwts_microcode.c   |    2 +-
>   src/lib/src/fwts_multiproc.c   |    8 +++----
>   src/lib/src/fwts_oops.c        |    4 ++--
>   src/lib/src/fwts_pipeio.c      |    6 +++---
>   src/lib/src/fwts_set.c         |    4 ++--
>   src/lib/src/fwts_smbios.c      |   14 ++++++------
>   src/lib/src/fwts_tag.c         |    1 -
>   src/lib/src/fwts_text_list.c   |    2 +-
>   src/lib/src/fwts_uefi.c        |    7 +++---
>   src/lib/src/fwts_virt.c        |    2 +-
>   src/lib/src/fwts_wakealarm.c   |    4 ++--
>   33 files changed, 128 insertions(+), 141 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi.c b/src/lib/src/fwts_acpi.c
> index 34316b1..e014d3a 100644
> --- a/src/lib/src/fwts_acpi.c
> +++ b/src/lib/src/fwts_acpi.c
> @@ -39,7 +39,6 @@ char *fwts_acpi_fadt_preferred_pm_profile[] = {
>   	"Performance Server",
>   };
>
> -
>   /*
>    *  fwts_acpi_table_get_header()
>    * 	copy into ACPI table header from raw data
> diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
> index 5c2e3da..4a0e7ec 100644
> --- a/src/lib/src/fwts_acpi_method.c
> +++ b/src/lib/src/fwts_acpi_method.c
> @@ -109,11 +109,9 @@ static acpi_eval_error  errors[] = {
>   	{ 0,				0,			NULL,			NULL }
>   };
>
> -
>   static fwts_list *fwts_object_names;
>   static bool fwts_method_initialized = false;
>
> -
>   /*
>    *  fwts_method_init()
>    *	Initialise ACPIA engine and collect method namespace
> @@ -149,7 +147,6 @@ int fwts_method_deinit(fwts_framework *fw)
>   	return ret;
>   }
>
> -
>   /*
>    *  fwts_method_get_names()
>    *	return list of method names
> @@ -159,8 +156,8 @@ fwts_list *fwts_method_get_names(void)
>   	return fwts_object_names;
>   }
>
> -/*
> - *  fwts_method_exists()
> +/*
> + *  fwts_method_exists()
>    *	return first matching name
>    */
>   char *fwts_method_exists(char *name)
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index 042c3ec..bd47e99 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -125,7 +125,7 @@ static void *fwts_acpi_load_table(const off_t addr)
>   	void *mem;
>   	void *table;
>   	int len;
> -	
> +
>   	if ((hdr = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_header))) == FWTS_MAP_FAILED)
>   		return NULL;
>
> @@ -143,7 +143,7 @@ static void *fwts_acpi_load_table(const off_t addr)
>
>   	memcpy(table, mem, len);
>   	(void)fwts_munmap(mem, len);
> -	
> +
>   	return table;
>   }
>
> @@ -317,7 +317,6 @@ static uint32_t fwts_fake_physical_addr(size_t size)
>   	return addr;
>   }
>
> -
>   /*
>    *  fwts_acpi_load_table_from_acpidump()
>    *	Load an ACPI table from the output of acpidump or fwts --dump
> @@ -340,8 +339,8 @@ static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
>
>   	/*
>   	 * Parse tablename followed by address, e.g.
> -	 *   DSTD @ 0xbfa02344
> -	 *   SSDT4 @ 0xbfa0f230
> +	 *   DSTD @ 0xbfa02344
> +	 *   SSDT4 @ 0xbfa0f230
>   	 */
>   	ptr = strstr(buffer, "@ 0x");
>   	if (ptr == NULL)
> @@ -360,7 +359,7 @@ static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
>
>   	if (sscanf(ptr, "@ 0x%Lx\n", &table_addr) < 1)
>   		return NULL; /* Can't parse address */
> -	
> +
>   	*(ptr-1) = '\0';
>   	strcpy(name, buffer);
>
> @@ -397,7 +396,6 @@ static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
>   	return table;
>   }
>
> -
>   /*
>    *  fwts_acpi_load_tables_from_acpidump()
>    *	Load in all ACPI tables from output of acpidump or fwts --dump
> @@ -413,7 +411,7 @@ static int fwts_acpi_load_tables_from_acpidump(fwts_framework *fw)
>   	}
>
>   	while (!feof(fp)) {
> -		uint64_t addr;		
> +		uint64_t addr;
>   		uint8_t *table;
>   		size_t length;
>   		char name[16];
> @@ -436,7 +434,7 @@ static uint8_t *fwts_acpi_load_table_from_file(const int fd, size_t *length)
>   	uint8_t *ptr = NULL;
>   	ssize_t n;
>   	size_t size = 0;
> -	char buffer[4096];	
> +	char buffer[4096];
>
>   	*length = 0;
>
> @@ -615,7 +613,7 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
>   	/* No XSDT? go and fake one */
>   	if (xsdt == NULL) {
>   		size_t size = sizeof(fwts_acpi_table_rsdt) + (count * sizeof(uint64_t));
> -		if ((xsdt = fwts_low_calloc(1, size)) == NULL)
> +		if ((xsdt = fwts_low_calloc(1, size)) == NULL)
>   			return FWTS_ERROR;
>
>   		for (i=0,j=0; j<count ;i++)
> diff --git a/src/lib/src/fwts_acpid.c b/src/lib/src/fwts_acpid.c
> index 6952276..3107052 100644
> --- a/src/lib/src/fwts_acpid.c
> +++ b/src/lib/src/fwts_acpid.c
> @@ -72,7 +72,7 @@ int fwts_acpi_event_open(void)
>   char *fwts_acpi_event_read(const int fd, size_t *length, const int timeout)
>   {
>   	char *ptr = NULL;
> -	char buffer[8192];	
> +	char buffer[8192];
>   	struct timeval tv;
>   	fd_set rfds;
>
> diff --git a/src/lib/src/fwts_alloc.c b/src/lib/src/fwts_alloc.c
> index 2657335..4495ad4 100644
> --- a/src/lib/src/fwts_alloc.c
> +++ b/src/lib/src/fwts_alloc.c
> @@ -27,7 +27,7 @@
>    * We implement a low memory allocator to allow us to allocate
>    * memory < 2G limit for the ACPICA table handling.  On 64 bit
>    * machines we habe to ensure that cached copies of ACPI tables
> - * have addresses that can be addressed by the legacy 32 bit
> + * have addresses that can be addressed by the legacy 32 bit
>    * ACPI table pointers.
>    *
>    * This implementation is not intended to be a malloc replacement
> @@ -68,7 +68,7 @@ static void *fwts_low_mmap(const size_t requested_size)
>
>   	if ((fp = fopen("/proc/self/maps", "r")) == NULL)
>   		return MAP_FAILED;
> -	
> +
>   	while (fgets(buffer, sizeof(buffer), fp) != NULL) {
>   		sscanf(buffer, "%p-%p %*s %*x %*s %*u %s",
>   			&addr_start, &addr_end, pathname);
> @@ -77,7 +77,7 @@ static void *fwts_low_mmap(const size_t requested_size)
>   		    (last_addr_end < (void*)LIMIT_2GB)) {
>   			if ((addr_start - last_addr_end) > requested_size) {
>   				void *addr = last_addr_end;
> -				ret = mmap(addr, requested_size, PROT_READ | PROT_WRITE,
> +				ret = mmap(addr, requested_size, PROT_READ | PROT_WRITE,
>   					MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, -1, 0);
>   				if (ret != MAP_FAILED)
>   					break;	/* Success! */
> @@ -115,10 +115,10 @@ void *fwts_low_calloc(const size_t nmemb, const size_t size)
>   	fwts_mmap_header *hdr;
>
>   	n += sizeof(fwts_mmap_header);
> -	
> +
>   #ifdef MAP_32BIT
>   	/* Not portable, only x86 */
> -	ret = mmap(NULL, n, PROT_READ | PROT_WRITE,
> +	ret = mmap(NULL, n, PROT_READ | PROT_WRITE,
>   		MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
>   #else
>   	/* We don't have a native MAP_32BIT, so bodge our own */
> @@ -164,7 +164,7 @@ void *fwts_low_realloc(const void *ptr, const size_t size)
>   		(ptr - sizeof(fwts_mmap_header));
>
>   	/* sanity check */
> -	if (hdr->magic != FWTS_ALLOC_MAGIC)
> +	if (hdr->magic != FWTS_ALLOC_MAGIC)
>   		return NULL;
>
>   	if ((ret = fwts_low_malloc(size)) == NULL)
> diff --git a/src/lib/src/fwts_args.c b/src/lib/src/fwts_args.c
> index 8c7d487..a0dc5af 100644
> --- a/src/lib/src/fwts_args.c
> +++ b/src/lib/src/fwts_args.c
> @@ -62,7 +62,7 @@ int fwts_args_init(void)
>    *	add a table of options and handler for these options
>    */
>   int fwts_args_add_options(fwts_option *options, fwts_args_optarg_handler handler, fwts_args_optarg_check check)
> -{	
> +{
>   	int n;
>   	fwts_options_table *options_table;
>
> @@ -118,12 +118,12 @@ int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
>   		for (i=0; i<options_table->num_options; i++, n++) {
>   			char *short_name = options_table->options[i].short_name;
>   			size_t len;
> -			
> +
>   			long_options[n].name    = options_table->options[i].long_name;
>   			long_options[n].has_arg = options_table->options[i].has_arg;
>   			long_options[n].flag    = 0;
>   			long_options[n].val     = 0;
> -	
> +
>   			if (short_name && (len = strlen(short_name)) > 0) {
>   				if (short_options) {
>   					short_options = realloc(short_options,
> @@ -165,7 +165,7 @@ int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
>   					if (index(short_name, c) != NULL) {
>   						found = true;
>   						break;
> -					}		
> +					}
>   				}
>   			} else if (options_table->num_options > option_index)
>   				found = true;
> @@ -187,7 +187,7 @@ int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
>   	fwts_list_foreach(item, &options_list) {
>   		options_table = fwts_list_data(fwts_options_table *, item);
>   		if (options_table->optarg_check != NULL) {
> -			ret = options_table->optarg_check(fw);
> +			ret = options_table->optarg_check(fw);
>   			if (ret != FWTS_OK)
>   				break;
>   		}
> @@ -224,7 +224,7 @@ void fwts_args_show_option(int width, char *option, char *explanation)
>   	fwts_list *text;
>   	fwts_list_link *item;
>   	int lineno = 0;
> -	
> +
>   	text = fwts_format_text(explanation,
>   		width < 0 ? (FWTS_MIN_TTY_WIDTH - FWTS_ARGS_WIDTH-1) : width);
>
> @@ -262,7 +262,7 @@ void fwts_args_show_options(void)
>   		options_table = fwts_list_data(fwts_options_table *, item);
>
>   		for (i=0; i<options_table->num_options; i++) {
> -			fwts_list_add_ordered(&sorted_options,
> +			fwts_list_add_ordered(&sorted_options,
>   				&options_table->options[i], fwts_args_compare_options);
>   		}
>   	}
> @@ -302,7 +302,7 @@ void fwts_args_show_options(void)
>   int fwts_args_free(void)
>   {
>   	fwts_list_free_items(&options_list, free);
> -	
> +
>   	return FWTS_OK;
>   }
>
> @@ -319,7 +319,7 @@ char *fwts_args_comma_list(const char *arg)
>   	char *retstr = NULL;
>   	char *tmparg;
>
> -	if ((tmparg = strdup(arg)) == NULL)
> +	if ((tmparg = strdup(arg)) == NULL)
>   		return NULL;
>
>           for (tmpstr = tmparg; (token = strtok_r(tmpstr, ",", &saveptr)) != NULL; tmpstr = NULL) {
> @@ -333,10 +333,10 @@ char *fwts_args_comma_list(const char *arg)
>   			free(tmparg);
>   			return NULL;
>   		}
> -        }	
> +        }
>
>   	free(tmparg);
> -	
> +
>   	/* Any empty list should return an empty string and not NULL */
>   	if (retstr == NULL)
>   		retstr = calloc(1, 1);
> diff --git a/src/lib/src/fwts_battery.c b/src/lib/src/fwts_battery.c
> index 423b525..656cc33 100644
> --- a/src/lib/src/fwts_battery.c
> +++ b/src/lib/src/fwts_battery.c
> @@ -81,7 +81,7 @@ static int fwts_battery_get_capacity_sys_fs(fwts_framework *fw,
>   			i++;
>   			if (!match)
>   				continue;
> -	
> +
>   			snprintf(path, sizeof(path), "%s/%s/uevent", FWTS_SYS_CLASS_POWER_SUPPLY, entry->d_name);
>   			if ((fp = fopen(path, "r")) == NULL) {
>   				fwts_log_info(fw, "Battery %s present but undersupported - no state present.", entry->d_name);
> @@ -233,7 +233,7 @@ static int fwts_battery_get_name_sys_fs(fwts_framework *fw, DIR *dir, int index,
>   			i++;
>   			if (!match)
>   				continue;
> -				
> +
>   			strcpy(name, entry->d_name);
>   			return FWTS_OK;
>   		}
> diff --git a/src/lib/src/fwts_checksum.c b/src/lib/src/fwts_checksum.c
> index 9f2aa8b..10373b7 100644
> --- a/src/lib/src/fwts_checksum.c
> +++ b/src/lib/src/fwts_checksum.c
> @@ -21,7 +21,7 @@
>
>   /*
>    *  fwts_checksum()
> - *	checksum a uint8_t * buffer
> + *	checksum a uint8_t * buffer
>    */
>   uint8_t fwts_checksum(const uint8_t *data, const int length)
>   {
> diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c
> index 094ced5..06df9a7 100644
> --- a/src/lib/src/fwts_cpu.c
> +++ b/src/lib/src/fwts_cpu.c
> @@ -68,7 +68,7 @@ int fwts_cpu_readmsr(const int cpu, const uint32_t reg, uint64_t *val)
>   		if (stat(buffer, &statbuf))
>   			return FWTS_ERROR; /* Really failed */
>   	}
> -	
> +
>   	if ((fd = open(buffer, O_RDONLY)) < 0)
>                   return FWTS_ERROR;
>
> @@ -169,7 +169,7 @@ static int fwts_cpu_matches_vendor_id(const char *vendor_id, bool *matches)
>
>   	if ((cpu = fwts_cpu_get_info(0)) == NULL)
>   		return FWTS_ERROR;
> -	
> +
>           *matches = (strstr(cpu->vendor_id, vendor_id) != NULL);
>
>   	fwts_cpu_free_info(cpu);
> @@ -199,7 +199,7 @@ fwts_bool fwts_cpu_has_c1e(void)
>
>   	if ((cpu = fwts_cpu_get_info(0)) == NULL)
>   		return FWTS_BOOL_ERROR;
> -	
> +
>           if (strstr(cpu->vendor_id, "AuthenticAMD") == NULL) {
>   		fwts_cpu_free_info(cpu);
>   		return FWTS_FALSE;
> @@ -243,7 +243,7 @@ int fwts_cpu_enumerate(void)
>
>   	if (cpus < 0)
>   		return FWTS_ERROR;
> -	
> +
>   	return cpus;
>   }
>
> @@ -308,7 +308,7 @@ static void fwts_cpu_consume_cycles(void)
>   void fwts_cpu_consume_complete(void)
>   {
>   	fwts_cpu_consume_kill();
> -	free(fwts_cpu_pids);	
> +	free(fwts_cpu_pids);
>   }
>
>   /*
> @@ -333,7 +333,7 @@ int fwts_cpu_consume_start(void)
>   		pid = fork();
>   		switch (pid) {
>   		case 0: /* Child */
> -			fwts_cpu_consume_cycles();	
> +			fwts_cpu_consume_cycles();
>   			break;
>   		case -1:
>   			/* Went wrong */
> diff --git a/src/lib/src/fwts_dump.c b/src/lib/src/fwts_dump.c
> index b684d8f..f14e8f9 100644
> --- a/src/lib/src/fwts_dump.c
> +++ b/src/lib/src/fwts_dump.c
> @@ -34,7 +34,6 @@
>    *  Utilities for the fwts --dump option
>    */
>
> -
>   /*
>    *  dump_data()
>    *	dump to path/filename a chunk of data of length len
> @@ -106,7 +105,7 @@ static int dump_exec(const char *path, const char *filename, const char *command
>   	}
>
>   	fwts_pipe_close(fd, pid);
> -	
> +
>   	ret = dump_data(path, filename, data, len);
>
>   	free(data);
> @@ -132,7 +131,7 @@ static int dump_dmidecode(fwts_framework *fw, const char *path, const char *file
>   static int dump_lspci(fwts_framework *fw, const char *path, const char *filename)
>   {
>   	char command[1024];
> -	
> +
>   	snprintf(command, sizeof(command), "%s -vv -nn", fw->lspci);
>
>   	return dump_exec(path, filename, command);
> @@ -188,7 +187,7 @@ static int dump_acpi_tables(fwts_framework *fw, const char *path)
>   		dump_acpi_table(table, fp);
>   	}
>   	fclose(fp);
> -		
> +
>   	return FWTS_OK;
>   }
>   #endif
> @@ -228,7 +227,7 @@ static int dump_readme(const char *path)
>   	}
>
>   	fclose(fp);
> -	
> +
>   	return FWTS_OK;
>   }
>
> @@ -249,7 +248,7 @@ int fwts_dump_info(fwts_framework *fw, const char *path)
>
>   	if (access(path, F_OK) != 0)
>   		mkdir(path, 0777);
> -	
> +
>
>   	if (dump_readme(path) != FWTS_OK)
>   		fprintf(stderr, "Failed to dump README.txt.\n");
> diff --git a/src/lib/src/fwts_formatting.c b/src/lib/src/fwts_formatting.c
> index b7ef6b4..a68204a 100644
> --- a/src/lib/src/fwts_formatting.c
> +++ b/src/lib/src/fwts_formatting.c
> @@ -101,7 +101,7 @@ fwts_list *fwts_format_text(const char *text, const int width)
>   		fwts_list_free(list, free);
>   		return NULL;
>   	}
> -	
> +
>   	linestart = tidied_text;
>
>   	while (*textptr) {
> @@ -121,7 +121,7 @@ fwts_list *fwts_format_text(const char *text, const int width)
>   				}
>   				fwts_text_list_append(list, tmp);
>   				free(tmp);
> -				
> +
>   				linestart = lastspace + ((isspace(*lastspace)) ? 1 : 0);
>   				linelen = textptr - linestart;
>   				lastspace = NULL;
> @@ -137,6 +137,6 @@ fwts_list *fwts_format_text(const char *text, const int width)
>   	fwts_text_list_append(list, tmp);
>   	free(tmp);
>   	free(tidied_text);
> -	
> +
>   	return list;
>   }
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index f53bbf2..c6536a6 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -92,7 +92,7 @@ typedef struct {
>
>   static const char *fwts_copyright[] = {
>   	"Some of this work - Copyright (c) 1999 - 2010, Intel Corp. All rights reserved.",
> -	"Some of this work - Copyright (c) 2010 - 2012, Canonical.",	
> +	"Some of this work - Copyright (c) 2010 - 2012, Canonical.",
>   	NULL
>   };
>
> @@ -191,14 +191,14 @@ static void fwts_framework_show_tests_brief(fwts_framework *fw)
>   			fwts_framework_compare_test_name);
>   	}
>
> -	fwts_list_foreach(item, &sorted) {		
> +	fwts_list_foreach(item, &sorted) {
>   		fwts_framework_test *test = fwts_list_data(fwts_framework_test*, item);
>   		int len = strlen(test->name) + 1;
>   		if ((n + len) > width)  {
>   			fprintf(stderr, "\n");
>   			n = 0;
>   		}
> -				
> +
>   		fprintf(stderr, "%s ", test->name);
>   		n += len;
>   	}
> @@ -255,7 +255,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, bool full)
>   				need_nl = 1;
>   				printf("%s%s:\n", categories[i].title,
>   					categories[i].flag & FWTS_UTILS ? "" : " tests");
> -	
> +
>   				fwts_list_foreach(item, &sorted) {
>   					test = fwts_list_data(fwts_framework_test *, item);
>   					if (full) {
> @@ -268,7 +268,7 @@ static void fwts_framework_show_tests(fwts_framework *fw, bool full)
>   						total += test->ops->total_tests;
>   					}
>   					else {
> -						printf(" %-13.13s %s\n", test->name,
> +						printf(" %-13.13s %s\n", test->name,
>   							test->ops->description ? test->ops->description : "");
>   					}
>   				}
> @@ -392,7 +392,7 @@ void fwts_framework_minor_test_progress(fwts_framework *fw, const int percent, c
>   		fprintf(stdout, "XXX\n");
>   		fprintf(stdout, "%d\n", (int)progress);
>   		fprintf(stdout, "So far: %s\n\n", buffer);
> -		fprintf(stdout, "%s\n\n", fw->current_major_test->ops->description ?
> +		fprintf(stdout, "%s\n\n", fw->current_major_test->ops->description ?
>   			fw->current_major_test->ops->description : "");
>   		fprintf(stdout, "Running test #%d: %s\n",
>   			fw->current_major_test_num,
> @@ -462,8 +462,8 @@ static int fwts_framework_total_summary(fwts_framework *fw)
>   }
>
>   static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts_framework_test *test)
> -{		
> -	fwts_framework_minor_test *minor_test;	
> +{
> +	fwts_framework_minor_test *minor_test;
>   	int ret;
>
>   	fw->current_major_test = test;
> @@ -512,7 +512,7 @@ static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts
>   		goto done;
>   	}
>
> -	if ((test->ops->init) &&
> +	if ((test->ops->init) &&
>   	    ((ret = test->ops->init(fw)) != FWTS_OK)) {
>   		char *msg = NULL;
>
> @@ -535,8 +535,8 @@ static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts
>   	}
>
>   	fwts_log_section_begin(fw->results, "subtests");
> -	for (minor_test = test->ops->minor_tests;
> -		*minor_test->test_func != NULL;
> +	for (minor_test = test->ops->minor_tests;
> +		*minor_test->test_func != NULL;
>   		minor_test++, fw->current_minor_test_num++) {
>
>   		fwts_log_section_begin(fw->results, "subtest");
> @@ -613,7 +613,7 @@ done:
>
>   /*
>    *  fwts_framework_tests_run()
> - *	
> + *
>    */
>   static void fwts_framework_tests_run(fwts_framework *fw, fwts_list *tests_to_run)
>   {
> @@ -636,7 +636,7 @@ static void fwts_framework_tests_run(fwts_framework *fw, fwts_list *tests_to_run
>   static fwts_framework_test *fwts_framework_test_find(fwts_framework *fw, const char *name)
>   {
>   	fwts_list_link *item;
> -	
> +
>   	fwts_list_foreach(item, &fwts_framework_test_list) {
>   		fwts_framework_test *test = fwts_list_data(fwts_framework_test *, item);
>   		if (strcmp(name, test->name) == 0)
> @@ -667,7 +667,7 @@ void fwts_framework_log(fwts_framework *fw,
>   		va_start(ap, fmt);
>   		vsnprintf(buffer, sizeof(buffer), fmt, ap);
>   		va_end(ap);
> -	} else
> +	} else
>   		*buffer = '\0';
>
>   	if (count)
> @@ -737,10 +737,10 @@ static void fwts_framework_syntax(char * const *argv)
>   	printf("Usage %s: [OPTION] [TEST]\n", argv[0]);
>
>   	fwts_args_show_options();
> -	
> +
>   	/* Tag on copyright info */
>   	printf("\n");
> -	for (i=0; fwts_copyright[i]; i++)
> +	for (i=0; fwts_copyright[i]; i++)
>   		printf("%s\n", fwts_copyright[i]);
>   }
>
> @@ -774,7 +774,7 @@ static void fwts_framework_heading_info(fwts_framework *fw, fwts_list *tests_to_
>   		tm.tm_hour, tm.tm_min, tm.tm_sec,
>   		buf.sysname, buf.nodename, buf.release, buf.version, buf.machine);
>   	fwts_log_nl(fw);
> -	
> +
>   	fwts_list_foreach(item, tests_to_run) {
>   		fwts_framework_test *test = fwts_list_data(fwts_framework_test *, item);
>   		len += strlen(test->name) + 1;
> @@ -873,7 +873,7 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
>   		switch (long_index) {
>   		case 0: /* --stdout-summary */
>   			fw->flags |= FWTS_FRAMEWORK_FLAGS_STDOUT_SUMMARY;
> -			break;	
> +			break;
>   		case 1: /* --help */
>   			fwts_framework_syntax(argv);
>   			return FWTS_COMPLETE;
> @@ -892,7 +892,7 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
>   			return FWTS_COMPLETE;
>   		case 6: /* --log-format */
>   			fwts_log_set_format(optarg);
> -			break;	
> +			break;
>   		case 7: /* --show-progress */
>   			fw->flags = (fw->flags &
>   					~(FWTS_FRAMEWORK_FLAGS_QUIET |
> @@ -1147,7 +1147,7 @@ int fwts_framework_args(const int argc, char **argv)
>
>   	/* Results log */
>   	if ((fw->results = fwts_log_open("fwts",
> -			fw->results_logname,	
> +			fw->results_logname,
>   			fw->flags & FWTS_FRAMEWORK_FLAGS_FORCE_CLEAN ? "w" : "a",
>   			fw->log_type)) == NULL) {
>   		ret = FWTS_ERROR;
> @@ -1186,7 +1186,7 @@ int fwts_framework_args(const int argc, char **argv)
>
>   	if (!(fw->flags & FWTS_FRAMEWORK_FLAGS_QUIET)) {
>   		char *filenames = fwts_log_get_filenames(fw->results_logname, fw->log_type);
> -		
> +
>   		if (filenames) {
>   			printf("Running %d tests, results appended to %s\n",
>   				fwts_list_len(&tests_to_run),
> @@ -1236,10 +1236,10 @@ tidy_close:
>   	fwts_list_free_items(&fwts_framework_test_list, free);
>
>   	/* Failed tests flagged an error */
> -	if ((fw->total.failed > 0) || (fw->total.warning > 0))	
> +	if ((fw->total.failed > 0) || (fw->total.warning > 0))
>   		ret = FWTS_ERROR;
>
>   	free(fw);
> -	
> +
>   	return ret;
>   }
> diff --git a/src/lib/src/fwts_get.c b/src/lib/src/fwts_get.c
> index 107e3c7..be56eca 100644
> --- a/src/lib/src/fwts_get.c
> +++ b/src/lib/src/fwts_get.c
> @@ -23,26 +23,25 @@
>
>   #include "fwts.h"
>
> -
>   /*
>    *  fwts_get()
>    *	get a string from a file. used to gather text from /proc or /sys entries
>    */
>   char *fwts_get(const char *file)
> -{	
> +{
>   	FILE *fp;
>   	char buffer[4096];
>
>   	if ((fp = fopen(file, "r")) == NULL)
>   		return NULL;
> -	
> +
>   	if (fgets(buffer, sizeof(buffer), fp) == NULL) {
>   		fclose(fp);
>   		return NULL;
>   	}
>
>   	fclose(fp);
> -	
> +
>   	return strdup(buffer);
>   }
>
> @@ -55,7 +54,7 @@ int fwts_get_int(const char *file, int *value)
>   	char *data;
>
>   	*value = 0;
> -	
> +
>   	if ((data = fwts_get(file)) == NULL) {
>   		*value = 0;
>   		return FWTS_ERROR;
> diff --git a/src/lib/src/fwts_gpe.c b/src/lib/src/fwts_gpe.c
> index 00b058b..df7ba2a 100644
> --- a/src/lib/src/fwts_gpe.c
> +++ b/src/lib/src/fwts_gpe.c
> @@ -58,7 +58,7 @@ int fwts_gpe_read(fwts_gpe **gpes)
>
>   	if ((dir = opendir(FWTS_GPE_PATH)) == NULL)
>   		return FWTS_ERROR;
> -	
> +
>   	while ((entry = readdir(dir)) != NULL) {
>   		if ((strncmp(entry->d_name, "gpe", 3) == 0) ||
>   		    (strncmp(entry->d_name, "sci",3) == 0)) {
> @@ -70,7 +70,7 @@ int fwts_gpe_read(fwts_gpe **gpes)
>
>   				if (((*gpes)[n].name  = strdup(entry->d_name)) == NULL)
>   					goto error;
> -				
> +
>   				snprintf(path, sizeof(path), "%s/%s", FWTS_GPE_PATH, entry->d_name);
>   				if ((data = fwts_get(path)) != NULL) {
>   					(*gpes)[n].count = atoi(data);
> @@ -99,7 +99,7 @@ error:
>    * 	update the result in gpe_delta.
>    */
>   int fwts_gpe_delta(int **gpe_delta, const fwts_gpe *start, const fwts_gpe *end, const int n)
> -{	
> +{
>   	int i;
>   	if (((*gpe_delta) = calloc(n, sizeof(int))) == NULL)
>   		return FWTS_ERROR;
> @@ -162,7 +162,7 @@ void fwts_gpe_test(fwts_framework *fw, const fwts_gpe *gpes_start, const fwts_gp
>   		}
>   	}
>   	free(deltas);
> -	
> +
>   	if (sci == 0)
>   		fwts_failed(fw, LOG_LEVEL_HIGH, "NoSCIInterrupts", "Did not detect any SCI interrupts.");
>
> diff --git a/src/lib/src/fwts_guid.c b/src/lib/src/fwts_guid.c
> index a532170..510cb25 100644
> --- a/src/lib/src/fwts_guid.c
> +++ b/src/lib/src/fwts_guid.c
> @@ -28,7 +28,7 @@
>    */
>   void fwts_guid_buf_to_str(uint8_t *guid, char *guid_str, size_t guid_str_len)
>   {
> -	if (guid_str && guid_str_len > 36)
> +	if (guid_str && guid_str_len > 36)
>           	snprintf(guid_str, guid_str_len, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
>   			guid[3], guid[2], guid[1], guid[0], guid[5], guid[4], guid[7], guid[6],
>   			guid[8], guid[9], guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]);
> diff --git a/src/lib/src/fwts_hwinfo.c b/src/lib/src/fwts_hwinfo.c
> index 86d014e..b540b98 100644
> --- a/src/lib/src/fwts_hwinfo.c
> +++ b/src/lib/src/fwts_hwinfo.c
> @@ -23,7 +23,7 @@
>
>   /*
>    *  fwts_hwinfo_get()
> - *	gather H/W information
> + *	gather H/W information
>    */
>   int fwts_hwinfo_get(fwts_framework *fw, fwts_hwinfo *hwinfo)
>   {
> diff --git a/src/lib/src/fwts_iasl.c b/src/lib/src/fwts_iasl.c
> index 736a4e3..9b3b873 100644
> --- a/src/lib/src/fwts_iasl.c
> +++ b/src/lib/src/fwts_iasl.c
> @@ -52,7 +52,7 @@ static int fwts_iasl_dump_aml_to_file(fwts_framework *fw,
>   		close(fd);
>   		(void)unlink(amlfile);
>   		return FWTS_ERROR;
> -	}	
> +	}
>   	close(fd);
>
>   	return FWTS_OK;
> @@ -166,7 +166,7 @@ int fwts_iasl_disassemble_all_to_file(fwts_framework *fw)
>    * 	any re-assembly errors into list iasl_errors.
>    */
>   int fwts_iasl_reassemble(fwts_framework *fw,
> -	const uint8_t *data,
> +	const uint8_t *data,
>   	const int len,
>   	fwts_list **iasl_disassembly,
>   	fwts_list **iasl_errors)
> diff --git a/src/lib/src/fwts_interactive.c b/src/lib/src/fwts_interactive.c
> index 2b424b5..07d3f39 100644
> --- a/src/lib/src/fwts_interactive.c
> +++ b/src/lib/src/fwts_interactive.c
> @@ -37,7 +37,7 @@ static int fwts_getchar(int *ch)
>
>   	*ch = -1;
>
> -	if (tcgetattr(fd, &oldterm) < 0)
> +	if (tcgetattr(fd, &oldterm) < 0)
>   		return FWTS_ERROR;
>
>   	memcpy(&newterm, &oldterm, sizeof(struct termios));
> @@ -49,8 +49,8 @@ static int fwts_getchar(int *ch)
>   		return FWTS_ERROR;
>
>   	*ch = getchar();
> -	
> -	if (tcsetattr(fd, TCSANOW, &oldterm) < 0)
> +
> +	if (tcsetattr(fd, TCSANOW, &oldterm) < 0)
>   		return FWTS_ERROR;
>
>   	return FWTS_OK;
> @@ -83,7 +83,7 @@ int fwts_press_enter(fwts_framework *fw)
>
>   	fprintf(stdout, "Press <Enter> to continue");
>   	fflush(stdout);
> -	
> +
>   	do {
>   		if (fwts_getchar(&ch) == FWTS_ERROR) {
>   			fwts_log_error(fw, "fwts_getchar() failed.");
> @@ -93,7 +93,7 @@ int fwts_press_enter(fwts_framework *fw)
>
>   	fprintf(stdout, "\n");
>   	fflush(stdout);
> -	
> +
>   	return FWTS_OK;
>   }
>
> @@ -111,7 +111,7 @@ int fwts_get_reply(fwts_framework *fw, const char *message, const char *options)
>   	for (;;) {
>
>   		if (fwts_getchar(&ch) == FWTS_ERROR) {
> -			fwts_log_error(fw, "fwts_getchar() failed.");	
> +			fwts_log_error(fw, "fwts_getchar() failed.");
>   			break;
>   		}
>   		if (index(options, ch) != NULL)
> diff --git a/src/lib/src/fwts_keymap.c b/src/lib/src/fwts_keymap.c
> index 10c5e3b..b60c331 100644
> --- a/src/lib/src/fwts_keymap.c
> +++ b/src/lib/src/fwts_keymap.c
> @@ -51,7 +51,7 @@ void fwts_keymap_free(fwts_list *keylist)
>    *	in a list of keymap items.
>    */
>   fwts_list *fwts_keymap_load(const char *machine)
> -{	
> +{
>   	FILE *fp;
>   	char buffer[4096];
>   	char path[PATH_MAX];
> @@ -59,7 +59,7 @@ fwts_list *fwts_keymap_load(const char *machine)
>
>   	if ((keymap_list = fwts_list_new()) == NULL)
>   		return NULL;
> -	
> +
>   	snprintf(path, sizeof(path), "%s/%s", FWTS_KEYMAP_PATH, machine);
>
>   	if ((fp = fopen(path, "r")) == NULL)
> @@ -116,7 +116,7 @@ fwts_list *fwts_keymap_load(const char *machine)
>   	}
>
>   	fclose(fp);
> -	
> +
>   	return keymap_list;
>   }
>
> diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
> index 7b7fb41..93dbb06 100644
> --- a/src/lib/src/fwts_klog.c
> +++ b/src/lib/src/fwts_klog.c
> @@ -68,7 +68,7 @@ fwts_list *fwts_klog_read(void)
>
>   	if ((buffer = calloc(1, len)) == NULL)
>   		return NULL;
> -	
> +
>   	if (klogctl(3, buffer, len) < 0) {
>   		free(buffer);
>   		return NULL;
> @@ -76,7 +76,7 @@ fwts_list *fwts_klog_read(void)
>
>   	list = fwts_list_from_text(buffer);
>   	free(buffer);
> -	
> +
>   	return list;
>   }
>
> @@ -131,10 +131,10 @@ int fwts_klog_scan(fwts_framework *fw,
>   		if (*newline) {
>   			int matched = 0;
>   			fwts_list_link *l;
> -			fwts_list_foreach(l, klog_reduced) {	
> +			fwts_list_foreach(l, klog_reduced) {
>   				char *line;
>   				klog_reduced_item *reduced = fwts_list_data(klog_reduced_item *, l);
> -				
> +
>   				line = fwts_klog_remove_timestamp(reduced->line);
>   				if (strcmp(newline, line) == 0) {
>   					reduced->repeated++;
> @@ -144,7 +144,7 @@ int fwts_klog_scan(fwts_framework *fw,
>   			}
>   			if (!matched) {
>   				klog_reduced_item *new;
> -	
> +
>   				if ((new = calloc(1, sizeof(klog_reduced_item))) == NULL) {
>   					fwts_list_free(klog_reduced, free);
>   					return FWTS_ERROR;
> @@ -272,7 +272,7 @@ static fwts_compare_mode fwts_klog_compare_mode_str_to_val(const char *str)
>   	else
>   		return FWTS_COMPARE_UNKNOWN;
>   }
> -		
> +
>   #define JSON_ERROR	((json_object*)-1)
>
>   /*
> @@ -311,12 +311,12 @@ static int fwts_klog_check(fwts_framework *fw,
>   		fwts_log_error(fw, "Cannot load klog data from %s.", json_data_path);
>   		return FWTS_ERROR;
>   	}
> -		
> +
>   	if ((klog_table = json_object_object_get(klog_objs, table)) == JSON_ERROR) {
>   		fwts_log_error(fw, "Cannot fetch klog table object '%s' from %s.", table, json_data_path);
>   		goto fail_put;
>   	}
> -		
> +
>   	n = json_object_array_length(klog_table);
>
>   	/* Last entry is null to indicate end, so alloc n+1 items */
> @@ -367,13 +367,13 @@ fail:
>   	free(patterns);
>   fail_put:
>   	json_object_put(klog_objs);
> -	
> +
>   	return ret;
>   }
>
>   int fwts_klog_firmware_check(fwts_framework *fw, fwts_klog_progress_func progress,
>   	fwts_list *klog, int *errors)
> -{	
> +{
>   	return fwts_klog_check(fw, "firmware_error_warning_patterns",
>   		progress, klog, errors);
>   }
> diff --git a/src/lib/src/fwts_log.c b/src/lib/src/fwts_log.c
> index 55ebd06..6ed32c1 100644
> --- a/src/lib/src/fwts_log.c
> +++ b/src/lib/src/fwts_log.c
> @@ -219,7 +219,6 @@ void fwts_log_print_fields(void)
>   	printf("\n");
>   }
>
> -
>   /*
>    *  fwts_log_str_to_field()
>    *	return log field of a given string, 0 if not matching
> diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
> index a0ca16f..8b29315 100644
> --- a/src/lib/src/fwts_memorymap.c
> +++ b/src/lib/src/fwts_memorymap.c
> @@ -100,7 +100,7 @@ static int fwts_register_memory_map_line(fwts_list *memory_map_list, const uint6
>
>   	if ((entry = calloc(1, sizeof(fwts_memory_map_entry))) == NULL)
>   		return FWTS_ERROR;
> -	
> +
>   	entry->start_address = start;
>   	entry->end_address   = end;
>   	entry->type          = type;
> @@ -153,7 +153,7 @@ fwts_bool fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_t
>   	/* when we don't have FWTS_MEMORY_MAP info, assume all is fair */
>   	if (memory_map_list == NULL)
>   		return FWTS_TRUE;
> -	
> +
>   	/* bios data area is always reserved */
>   	if ((memory >= 640 * 1024) && (memory <= 1024*1024))
>   		return FWTS_TRUE;
> @@ -233,7 +233,7 @@ fwts_list *fwts_memory_map_table_load_from_klog(fwts_framework *fw)
>
>   	if ((memory_map_list = fwts_list_new()) == NULL)
>   		return NULL;
> -	
> +
>   	fwts_list_iterate(klog, fwts_memory_map_dmesg_info, memory_map_list);
>   	fwts_klog_free(klog);
>
> @@ -268,7 +268,7 @@ static fwts_memory_map_entry *fwts_memory_map_table_read_entry(const char *which
>   	}
>   	sscanf(data, "0x%llx", (unsigned long long*)&entry->end_address);
>   	free(data);
> -	
> +
>   	snprintf(path, sizeof(path), "/sys/firmware/memmap/%s/type", which);
>   	if ((data = fwts_get(path)) == NULL) {
>   		free(entry);
> diff --git a/src/lib/src/fwts_microcode.c b/src/lib/src/fwts_microcode.c
> index b3784ef..209cf29 100644
> --- a/src/lib/src/fwts_microcode.c
> +++ b/src/lib/src/fwts_microcode.c
> @@ -110,7 +110,7 @@ int fwts_update_microcode(fwts_framework *fw, const char *device, const char *fi
>   		return FWTS_ERROR;
>   	}
>
> -	close(fd);	
> +	close(fd);
>   	free(microcode);
>
>   	return FWTS_OK;
> diff --git a/src/lib/src/fwts_multiproc.c b/src/lib/src/fwts_multiproc.c
> index 693ff5a..01f4561 100644
> --- a/src/lib/src/fwts_multiproc.c
> +++ b/src/lib/src/fwts_multiproc.c
> @@ -79,7 +79,7 @@ static int fwts_mp_get_address(uint32_t *phys_addr)
>   			continue;
>
>   		for (ptr = mem; ptr < (uint8_t*)(mem + size); ptr+=16) {
> -			if ((*ptr == '_') &&
> +			if ((*ptr == '_') &&
>   			    (*(ptr + 1) == 'M') &&
>   			    (*(ptr + 2) == 'P') &&
>   			    (*(ptr + 3) == '_')) {
> @@ -100,7 +100,7 @@ static int fwts_mp_get_address(uint32_t *phys_addr)
>   	return FWTS_ERROR;
>   }
>
> -/*
> +/*
>    *  fwts_mp_data_get()
>    *	find _MP_ data, map in header and table,
>    *	collect up entries into a list
> @@ -128,7 +128,7 @@ int fwts_mp_data_get(fwts_mp_data *data)
>   	header = (fwts_mp_config_table_header *)mem;
>   	fwts_list_init(&data->entries);
>
> -	data->size = header->base_table_length +
> +	data->size = header->base_table_length +
>   		((header->spec_rev == 1) ? 0 : header->extended_table_length);
>
>   	/* Remap with full header and table now we know how big it is */
> @@ -185,7 +185,7 @@ int fwts_mp_data_get(fwts_mp_data *data)
>
>   /*
>    *  fwts_mp_data_free()
> - *	free entries and unmap
> + *	free entries and unmap
>    */
>   int fwts_mp_data_free(fwts_mp_data *data)
>   {
> diff --git a/src/lib/src/fwts_oops.c b/src/lib/src/fwts_oops.c
> index df9c3c7..fe557e5 100644
> --- a/src/lib/src/fwts_oops.c
> +++ b/src/lib/src/fwts_oops.c
> @@ -54,7 +54,7 @@ void fwts_oops_dump(fwts_framework *fw, fwts_list_link *bug_item, int *oopses)
>   			dumpable |= FWTS_OOPS_GOT_STACK;
>   		if (strstr(line, "Call Trace:"))
>   			dumpable |= FWTS_OOPS_GOT_CALL_TRACE;
> -		if (strstr(line, "--[ end trace")) {
> +		if (strstr(line, "--[ end trace")) {
>   			dumpable |= FWTS_OOPS_GOT_END_TRACE;
>   			break;
>   		}
> @@ -80,7 +80,7 @@ void fwts_oops_dump(fwts_framework *fw, fwts_list_link *bug_item, int *oopses)
>   		fwts_log_info(fw, "Found OOPS (%d):", *oopses);
>
>   		while (bug_item != NULL && bug_item != item) {
> -			fwts_log_info_verbatum(fw, "  %s",
> +			fwts_log_info_verbatum(fw, "  %s",
>   				fwts_klog_remove_timestamp(fwts_list_data(char *, bug_item)));
>   			bug_item = bug_item->next;
>   		}
> diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
> index d4abfd5..cb6bd1e 100644
> --- a/src/lib/src/fwts_pipeio.c
> +++ b/src/lib/src/fwts_pipeio.c
> @@ -41,7 +41,7 @@ int fwts_pipe_open(const char *command, pid_t *childpid)
>   {
>   	int pipefds[2];
>   	pid_t pid;
> -	
> +
>   	if (pipe(pipefds) < 0)
>   		return -1;
>
> @@ -68,7 +68,7 @@ int fwts_pipe_open(const char *command, pid_t *childpid)
>   		/* Parent */
>   		close(pipefds[1]);
>   		*childpid = pid;
> -	
> +
>   		return pipefds[0];
>   	}
>   }
> @@ -82,7 +82,7 @@ int fwts_pipe_open(const char *command, pid_t *childpid)
>   char *fwts_pipe_read(const int fd, ssize_t *length)
>   {
>   	char *ptr = NULL;
> -	char buffer[8192];	
> +	char buffer[8192];
>   	ssize_t n;
>   	ssize_t size = 0;
>   	*length = 0;
> diff --git a/src/lib/src/fwts_set.c b/src/lib/src/fwts_set.c
> index 657d25c..e4b0e0c 100644
> --- a/src/lib/src/fwts_set.c
> +++ b/src/lib/src/fwts_set.c
> @@ -28,14 +28,14 @@
>    *	values in /sys or /proc
>    */
>   int fwts_set(const char *text, const char *file)
> -{	
> +{
>   	FILE *fp;
>
>   	if ((fp = fopen(file, "w")) == NULL)
>   		return FWTS_ERROR;
>
>   	fprintf(fp, "%s\n", text);
> -	fclose(fp);	
> +	fclose(fp);
>
>   	return FWTS_OK;
>   }
> diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
> index ef6d076..b9c4540 100644
> --- a/src/lib/src/fwts_smbios.c
> +++ b/src/lib/src/fwts_smbios.c
> @@ -35,7 +35,7 @@ static void *fwts_smbios_find_entry_uefi(fwts_framework *fw, fwts_smbios_entry *
>   			return NULL;
>   		}
>   		*entry = *mapped_entry;
> -		*type  = FWTS_SMBIOS;	
> +		*type  = FWTS_SMBIOS;
>   		(void)fwts_munmap(mapped_entry, sizeof(fwts_smbios_entry));
>   	}
>   	return addr;
> @@ -61,19 +61,19 @@ static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
>   		if ((*(mem+i)   == '_') &&
>   		    (*(mem+i+1) == 'S') &&
>   		    (*(mem+i+2) == 'M') &&
> -		    (*(mem+i+3) == '_') &&
> +		    (*(mem+i+3) == '_') &&
>   		    (fwts_checksum(mem + i, 16) == 0)) {
>   			addr = (void*)FWTS_SMBIOS_REGION_START + i;
>   			memcpy(entry, (void*)(mem + i), sizeof(fwts_smbios_entry));
> -			*type  = FWTS_SMBIOS;	
> +			*type  = FWTS_SMBIOS;
>   			break;
>   		}
>   		/* Legacy DMI entry point */
>   		if ((*(mem+i)   == '_') &&
>   		    (*(mem+i+1) == 'D') &&
>   		    (*(mem+i+2) == 'M') &&
> -		    (*(mem+i+3) == 'I') &&
> -		    (*(mem+i+4) == '_') &&
> +		    (*(mem+i+3) == 'I') &&
> +		    (*(mem+i+4) == '_') &&
>   		    (fwts_checksum(mem + i, 15) == 0)) {
>   			memset(entry, 0, 16);
>   			addr = (void*)FWTS_SMBIOS_REGION_START + i;
> @@ -82,7 +82,6 @@ static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
>   			break;
>   		}
>   	}
> -			
>
>           (void)fwts_munmap(mem, FWTS_SMBIOS_REGION_SIZE);
>
> @@ -91,7 +90,7 @@ static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
>
>   /*
>    *  fwts_smbios_find_entry()
> - *	find SMBIOS structure table entry
> + *	find SMBIOS structure table entry
>    */
>   void *fwts_smbios_find_entry(fwts_framework *fw,
>   	fwts_smbios_entry *entry,
> @@ -119,7 +118,6 @@ void *fwts_smbios_find_entry(fwts_framework *fw,
>   				break;
>   			}
>   		}
> -	
>   	}
>   	return addr;
>   }
> diff --git a/src/lib/src/fwts_tag.c b/src/lib/src/fwts_tag.c
> index 38d1449..d8e9dad 100644
> --- a/src/lib/src/fwts_tag.c
> +++ b/src/lib/src/fwts_tag.c
> @@ -82,7 +82,6 @@ static fwts_tag_info fwts_tags[] = {
>   	{ 0, NULL, NULL }
>   };
>
> -
>   /*
>    *  fwts_tag_id_str_to_tag()
>    *	given a tag string, return the tag
> diff --git a/src/lib/src/fwts_text_list.c b/src/lib/src/fwts_text_list.c
> index 373fe19..4e02f0e 100644
> --- a/src/lib/src/fwts_text_list.c
> +++ b/src/lib/src/fwts_text_list.c
> @@ -115,6 +115,6 @@ fwts_list *fwts_list_from_text(const char *text)
>
>   		fwts_list_append(list, str);
>   	}
> -	
> +
>   	return list;
>   }
> diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
> index 9a125f5..d4f68f4 100644
> --- a/src/lib/src/fwts_uefi.c
> +++ b/src/lib/src/fwts_uefi.c
> @@ -27,7 +27,6 @@
>   #include "fwts.h"
>   #include "fwts_uefi.h"
>
> -
>   static inline void fwts_uefi_set_filename(char *filename, const int len, const char *varname)
>   {
>   	snprintf(filename, len, "/sys/firmware/efi/vars/%s/raw_var", varname);
> @@ -42,7 +41,7 @@ void fwts_uefi_str16_to_str(char *dst, const size_t len, const uint16_t *src)
>   	size_t i = len;
>
>   	while ((*src) && (i > 1)) {
> -		*dst++ = *(src++) & 0xff;		
> +		*dst++ = *(src++) & 0xff;
>   		i--;
>   	}
>   	*dst = '\0';
> @@ -86,7 +85,7 @@ int fwts_uefi_get_variable(const char *varname, fwts_uefi_var *var)
>
>   	fwts_uefi_set_filename(filename, sizeof(filename), varname);
>
> -	if ((fd = open(filename, O_RDONLY)) < 0)
> +	if ((fd = open(filename, O_RDONLY)) < 0)
>   		return FWTS_ERROR;
>
>   	memset(var, 0, sizeof(fwts_uefi_var));
> @@ -115,7 +114,7 @@ int fwts_uefi_set_variable(const char *varname, fwts_uefi_var *var)
>
>   	fwts_uefi_set_filename(filename, sizeof(filename), varname);
>
> -	if ((fd = open(filename, O_WRONLY)) < 0)
> +	if ((fd = open(filename, O_WRONLY)) < 0)
>   		return FWTS_ERROR;
>
>   	if ((n = write(fd, var, sizeof(fwts_uefi_var))) != sizeof(fwts_uefi_var))
> diff --git a/src/lib/src/fwts_virt.c b/src/lib/src/fwts_virt.c
> index 22ebc79..ad5bec0 100644
> --- a/src/lib/src/fwts_virt.c
> +++ b/src/lib/src/fwts_virt.c
> @@ -59,7 +59,7 @@ void fwts_exec_cpuid(const int cpu, const uint32_t cmd, cpu_registers* regs)
>   			   : "a"(cmd)
>   	);
>   #endif
> -	
> +
>   	if (cpu != CURRENT_CPU)
>   		sched_setaffinity(0, sizeof(oldmask), &oldmask);
>   }
> diff --git a/src/lib/src/fwts_wakealarm.c b/src/lib/src/fwts_wakealarm.c
> index 56d4317..a93e34a 100644
> --- a/src/lib/src/fwts_wakealarm.c
> +++ b/src/lib/src/fwts_wakealarm.c
> @@ -41,14 +41,14 @@ int fwts_wakealarm_get_irq_state(void)
>   	if ((fp = fopen("/proc/driver/rtc", "r")) == NULL)
>   		return FWTS_ERROR;
>
> -	while (fscanf(fp, "%s : %s\n", field, value) != EOF) {	
> +	while (fscanf(fp, "%s : %s\n", field, value) != EOF) {
>   		if (!strcmp(field, "alarm_IRQ")) {
>   			fclose(fp);
>   			return strcmp(value, "no");
>   		}
>   	}
>   	fclose(fp);
> -	
> +
>   	return FWTS_ERROR;
>   }
>
>

Acked-by: Ivan Hu<ivan.hu@canonical.com>

Patch

diff --git a/src/lib/src/fwts_acpi.c b/src/lib/src/fwts_acpi.c
index 34316b1..e014d3a 100644
--- a/src/lib/src/fwts_acpi.c
+++ b/src/lib/src/fwts_acpi.c
@@ -39,7 +39,6 @@  char *fwts_acpi_fadt_preferred_pm_profile[] = {
 	"Performance Server",
 };
 
-
 /*
  *  fwts_acpi_table_get_header()
  * 	copy into ACPI table header from raw data
diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
index 5c2e3da..4a0e7ec 100644
--- a/src/lib/src/fwts_acpi_method.c
+++ b/src/lib/src/fwts_acpi_method.c
@@ -109,11 +109,9 @@  static acpi_eval_error  errors[] = {
 	{ 0,				0,			NULL,			NULL }
 };
 
-
 static fwts_list *fwts_object_names;
 static bool fwts_method_initialized = false;
 
-
 /*
  *  fwts_method_init()
  *	Initialise ACPIA engine and collect method namespace
@@ -149,7 +147,6 @@  int fwts_method_deinit(fwts_framework *fw)
 	return ret;
 }
 
-
 /*
  *  fwts_method_get_names()
  *	return list of method names
@@ -159,8 +156,8 @@  fwts_list *fwts_method_get_names(void)
 	return fwts_object_names;
 }
 
-/*  
- *  fwts_method_exists() 
+/*
+ *  fwts_method_exists()
  *	return first matching name
  */
 char *fwts_method_exists(char *name)
diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
index 042c3ec..bd47e99 100644
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -125,7 +125,7 @@  static void *fwts_acpi_load_table(const off_t addr)
 	void *mem;
 	void *table;
 	int len;
-	
+
 	if ((hdr = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_header))) == FWTS_MAP_FAILED)
 		return NULL;
 
@@ -143,7 +143,7 @@  static void *fwts_acpi_load_table(const off_t addr)
 
 	memcpy(table, mem, len);
 	(void)fwts_munmap(mem, len);
-	
+
 	return table;
 }
 
@@ -317,7 +317,6 @@  static uint32_t fwts_fake_physical_addr(size_t size)
 	return addr;
 }
 
-
 /*
  *  fwts_acpi_load_table_from_acpidump()
  *	Load an ACPI table from the output of acpidump or fwts --dump
@@ -340,8 +339,8 @@  static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
 
 	/*
 	 * Parse tablename followed by address, e.g.
-	 *   DSTD @ 0xbfa02344 
-	 *   SSDT4 @ 0xbfa0f230 
+	 *   DSTD @ 0xbfa02344
+	 *   SSDT4 @ 0xbfa0f230
 	 */
 	ptr = strstr(buffer, "@ 0x");
 	if (ptr == NULL)
@@ -360,7 +359,7 @@  static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
 
 	if (sscanf(ptr, "@ 0x%Lx\n", &table_addr) < 1)
 		return NULL; /* Can't parse address */
-	
+
 	*(ptr-1) = '\0';
 	strcpy(name, buffer);
 
@@ -397,7 +396,6 @@  static uint8_t *fwts_acpi_load_table_from_acpidump(FILE *fp, char *name, uint64_
 	return table;
 }
 
-
 /*
  *  fwts_acpi_load_tables_from_acpidump()
  *	Load in all ACPI tables from output of acpidump or fwts --dump
@@ -413,7 +411,7 @@  static int fwts_acpi_load_tables_from_acpidump(fwts_framework *fw)
 	}
 
 	while (!feof(fp)) {
-		uint64_t addr;		
+		uint64_t addr;
 		uint8_t *table;
 		size_t length;
 		char name[16];
@@ -436,7 +434,7 @@  static uint8_t *fwts_acpi_load_table_from_file(const int fd, size_t *length)
 	uint8_t *ptr = NULL;
 	ssize_t n;
 	size_t size = 0;
-	char buffer[4096];	
+	char buffer[4096];
 
 	*length = 0;
 
@@ -615,7 +613,7 @@  static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
 	/* No XSDT? go and fake one */
 	if (xsdt == NULL) {
 		size_t size = sizeof(fwts_acpi_table_rsdt) + (count * sizeof(uint64_t));
-		if ((xsdt = fwts_low_calloc(1, size)) == NULL) 
+		if ((xsdt = fwts_low_calloc(1, size)) == NULL)
 			return FWTS_ERROR;
 
 		for (i=0,j=0; j<count ;i++)
diff --git a/src/lib/src/fwts_acpid.c b/src/lib/src/fwts_acpid.c
index 6952276..3107052 100644
--- a/src/lib/src/fwts_acpid.c
+++ b/src/lib/src/fwts_acpid.c
@@ -72,7 +72,7 @@  int fwts_acpi_event_open(void)
 char *fwts_acpi_event_read(const int fd, size_t *length, const int timeout)
 {
 	char *ptr = NULL;
-	char buffer[8192];	
+	char buffer[8192];
 	struct timeval tv;
 	fd_set rfds;
 
diff --git a/src/lib/src/fwts_alloc.c b/src/lib/src/fwts_alloc.c
index 2657335..4495ad4 100644
--- a/src/lib/src/fwts_alloc.c
+++ b/src/lib/src/fwts_alloc.c
@@ -27,7 +27,7 @@ 
  * We implement a low memory allocator to allow us to allocate
  * memory < 2G limit for the ACPICA table handling.  On 64 bit
  * machines we habe to ensure that cached copies of ACPI tables
- * have addresses that can be addressed by the legacy 32 bit 
+ * have addresses that can be addressed by the legacy 32 bit
  * ACPI table pointers.
  *
  * This implementation is not intended to be a malloc replacement
@@ -68,7 +68,7 @@  static void *fwts_low_mmap(const size_t requested_size)
 
 	if ((fp = fopen("/proc/self/maps", "r")) == NULL)
 		return MAP_FAILED;
-	
+
 	while (fgets(buffer, sizeof(buffer), fp) != NULL) {
 		sscanf(buffer, "%p-%p %*s %*x %*s %*u %s",
 			&addr_start, &addr_end, pathname);
@@ -77,7 +77,7 @@  static void *fwts_low_mmap(const size_t requested_size)
 		    (last_addr_end < (void*)LIMIT_2GB)) {
 			if ((addr_start - last_addr_end) > requested_size) {
 				void *addr = last_addr_end;
-				ret = mmap(addr, requested_size, PROT_READ | PROT_WRITE, 
+				ret = mmap(addr, requested_size, PROT_READ | PROT_WRITE,
 					MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, -1, 0);
 				if (ret != MAP_FAILED)
 					break;	/* Success! */
@@ -115,10 +115,10 @@  void *fwts_low_calloc(const size_t nmemb, const size_t size)
 	fwts_mmap_header *hdr;
 
 	n += sizeof(fwts_mmap_header);
-	
+
 #ifdef MAP_32BIT
 	/* Not portable, only x86 */
-	ret = mmap(NULL, n, PROT_READ | PROT_WRITE, 
+	ret = mmap(NULL, n, PROT_READ | PROT_WRITE,
 		MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
 #else
 	/* We don't have a native MAP_32BIT, so bodge our own */
@@ -164,7 +164,7 @@  void *fwts_low_realloc(const void *ptr, const size_t size)
 		(ptr - sizeof(fwts_mmap_header));
 
 	/* sanity check */
-	if (hdr->magic != FWTS_ALLOC_MAGIC) 
+	if (hdr->magic != FWTS_ALLOC_MAGIC)
 		return NULL;
 
 	if ((ret = fwts_low_malloc(size)) == NULL)
diff --git a/src/lib/src/fwts_args.c b/src/lib/src/fwts_args.c
index 8c7d487..a0dc5af 100644
--- a/src/lib/src/fwts_args.c
+++ b/src/lib/src/fwts_args.c
@@ -62,7 +62,7 @@  int fwts_args_init(void)
  *	add a table of options and handler for these options
  */
 int fwts_args_add_options(fwts_option *options, fwts_args_optarg_handler handler, fwts_args_optarg_check check)
-{	
+{
 	int n;
 	fwts_options_table *options_table;
 
@@ -118,12 +118,12 @@  int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
 		for (i=0; i<options_table->num_options; i++, n++) {
 			char *short_name = options_table->options[i].short_name;
 			size_t len;
-			
+
 			long_options[n].name    = options_table->options[i].long_name;
 			long_options[n].has_arg = options_table->options[i].has_arg;
 			long_options[n].flag    = 0;
 			long_options[n].val     = 0;
-	
+
 			if (short_name && (len = strlen(short_name)) > 0) {
 				if (short_options) {
 					short_options = realloc(short_options,
@@ -165,7 +165,7 @@  int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
 					if (index(short_name, c) != NULL) {
 						found = true;
 						break;
-					}		
+					}
 				}
 			} else if (options_table->num_options > option_index)
 				found = true;
@@ -187,7 +187,7 @@  int fwts_args_parse(fwts_framework *fw, int argc, char * const argv[])
 	fwts_list_foreach(item, &options_list) {
 		options_table = fwts_list_data(fwts_options_table *, item);
 		if (options_table->optarg_check != NULL) {
-			ret = options_table->optarg_check(fw); 
+			ret = options_table->optarg_check(fw);
 			if (ret != FWTS_OK)
 				break;
 		}
@@ -224,7 +224,7 @@  void fwts_args_show_option(int width, char *option, char *explanation)
 	fwts_list *text;
 	fwts_list_link *item;
 	int lineno = 0;
-	
+
 	text = fwts_format_text(explanation,
 		width < 0 ? (FWTS_MIN_TTY_WIDTH - FWTS_ARGS_WIDTH-1) : width);
 
@@ -262,7 +262,7 @@  void fwts_args_show_options(void)
 		options_table = fwts_list_data(fwts_options_table *, item);
 
 		for (i=0; i<options_table->num_options; i++) {
-			fwts_list_add_ordered(&sorted_options, 
+			fwts_list_add_ordered(&sorted_options,
 				&options_table->options[i], fwts_args_compare_options);
 		}
 	}
@@ -302,7 +302,7 @@  void fwts_args_show_options(void)
 int fwts_args_free(void)
 {
 	fwts_list_free_items(&options_list, free);
-	
+
 	return FWTS_OK;
 }
 
@@ -319,7 +319,7 @@  char *fwts_args_comma_list(const char *arg)
 	char *retstr = NULL;
 	char *tmparg;
 
-	if ((tmparg = strdup(arg)) == NULL) 
+	if ((tmparg = strdup(arg)) == NULL)
 		return NULL;
 
         for (tmpstr = tmparg; (token = strtok_r(tmpstr, ",", &saveptr)) != NULL; tmpstr = NULL) {
@@ -333,10 +333,10 @@  char *fwts_args_comma_list(const char *arg)
 			free(tmparg);
 			return NULL;
 		}
-        }	
+        }
 
 	free(tmparg);
-	
+
 	/* Any empty list should return an empty string and not NULL */
 	if (retstr == NULL)
 		retstr = calloc(1, 1);
diff --git a/src/lib/src/fwts_battery.c b/src/lib/src/fwts_battery.c
index 423b525..656cc33 100644
--- a/src/lib/src/fwts_battery.c
+++ b/src/lib/src/fwts_battery.c
@@ -81,7 +81,7 @@  static int fwts_battery_get_capacity_sys_fs(fwts_framework *fw,
 			i++;
 			if (!match)
 				continue;
-	
+
 			snprintf(path, sizeof(path), "%s/%s/uevent", FWTS_SYS_CLASS_POWER_SUPPLY, entry->d_name);
 			if ((fp = fopen(path, "r")) == NULL) {
 				fwts_log_info(fw, "Battery %s present but undersupported - no state present.", entry->d_name);
@@ -233,7 +233,7 @@  static int fwts_battery_get_name_sys_fs(fwts_framework *fw, DIR *dir, int index,
 			i++;
 			if (!match)
 				continue;
-				
+
 			strcpy(name, entry->d_name);
 			return FWTS_OK;
 		}
diff --git a/src/lib/src/fwts_checksum.c b/src/lib/src/fwts_checksum.c
index 9f2aa8b..10373b7 100644
--- a/src/lib/src/fwts_checksum.c
+++ b/src/lib/src/fwts_checksum.c
@@ -21,7 +21,7 @@ 
 
 /*
  *  fwts_checksum()
- *	checksum a uint8_t * buffer 
+ *	checksum a uint8_t * buffer
  */
 uint8_t fwts_checksum(const uint8_t *data, const int length)
 {
diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c
index 094ced5..06df9a7 100644
--- a/src/lib/src/fwts_cpu.c
+++ b/src/lib/src/fwts_cpu.c
@@ -68,7 +68,7 @@  int fwts_cpu_readmsr(const int cpu, const uint32_t reg, uint64_t *val)
 		if (stat(buffer, &statbuf))
 			return FWTS_ERROR; /* Really failed */
 	}
-	
+
 	if ((fd = open(buffer, O_RDONLY)) < 0)
                 return FWTS_ERROR;
 
@@ -169,7 +169,7 @@  static int fwts_cpu_matches_vendor_id(const char *vendor_id, bool *matches)
 
 	if ((cpu = fwts_cpu_get_info(0)) == NULL)
 		return FWTS_ERROR;
-	
+
         *matches = (strstr(cpu->vendor_id, vendor_id) != NULL);
 
 	fwts_cpu_free_info(cpu);
@@ -199,7 +199,7 @@  fwts_bool fwts_cpu_has_c1e(void)
 
 	if ((cpu = fwts_cpu_get_info(0)) == NULL)
 		return FWTS_BOOL_ERROR;
-	
+
         if (strstr(cpu->vendor_id, "AuthenticAMD") == NULL) {
 		fwts_cpu_free_info(cpu);
 		return FWTS_FALSE;
@@ -243,7 +243,7 @@  int fwts_cpu_enumerate(void)
 
 	if (cpus < 0)
 		return FWTS_ERROR;
-	
+
 	return cpus;
 }
 
@@ -308,7 +308,7 @@  static void fwts_cpu_consume_cycles(void)
 void fwts_cpu_consume_complete(void)
 {
 	fwts_cpu_consume_kill();
-	free(fwts_cpu_pids);	
+	free(fwts_cpu_pids);
 }
 
 /*
@@ -333,7 +333,7 @@  int fwts_cpu_consume_start(void)
 		pid = fork();
 		switch (pid) {
 		case 0: /* Child */
-			fwts_cpu_consume_cycles();	
+			fwts_cpu_consume_cycles();
 			break;
 		case -1:
 			/* Went wrong */
diff --git a/src/lib/src/fwts_dump.c b/src/lib/src/fwts_dump.c
index b684d8f..f14e8f9 100644
--- a/src/lib/src/fwts_dump.c
+++ b/src/lib/src/fwts_dump.c
@@ -34,7 +34,6 @@ 
  *  Utilities for the fwts --dump option
  */
 
-
 /*
  *  dump_data()
  *	dump to path/filename a chunk of data of length len
@@ -106,7 +105,7 @@  static int dump_exec(const char *path, const char *filename, const char *command
 	}
 
 	fwts_pipe_close(fd, pid);
-	
+
 	ret = dump_data(path, filename, data, len);
 
 	free(data);
@@ -132,7 +131,7 @@  static int dump_dmidecode(fwts_framework *fw, const char *path, const char *file
 static int dump_lspci(fwts_framework *fw, const char *path, const char *filename)
 {
 	char command[1024];
-	
+
 	snprintf(command, sizeof(command), "%s -vv -nn", fw->lspci);
 
 	return dump_exec(path, filename, command);
@@ -188,7 +187,7 @@  static int dump_acpi_tables(fwts_framework *fw, const char *path)
 		dump_acpi_table(table, fp);
 	}
 	fclose(fp);
-		
+
 	return FWTS_OK;
 }
 #endif
@@ -228,7 +227,7 @@  static int dump_readme(const char *path)
 	}
 
 	fclose(fp);
-	
+
 	return FWTS_OK;
 }
 
@@ -249,7 +248,7 @@  int fwts_dump_info(fwts_framework *fw, const char *path)
 
 	if (access(path, F_OK) != 0)
 		mkdir(path, 0777);
-	
+
 
 	if (dump_readme(path) != FWTS_OK)
 		fprintf(stderr, "Failed to dump README.txt.\n");
diff --git a/src/lib/src/fwts_formatting.c b/src/lib/src/fwts_formatting.c
index b7ef6b4..a68204a 100644
--- a/src/lib/src/fwts_formatting.c
+++ b/src/lib/src/fwts_formatting.c
@@ -101,7 +101,7 @@  fwts_list *fwts_format_text(const char *text, const int width)
 		fwts_list_free(list, free);
 		return NULL;
 	}
-	
+
 	linestart = tidied_text;
 
 	while (*textptr) {
@@ -121,7 +121,7 @@  fwts_list *fwts_format_text(const char *text, const int width)
 				}
 				fwts_text_list_append(list, tmp);
 				free(tmp);
-				
+
 				linestart = lastspace + ((isspace(*lastspace)) ? 1 : 0);
 				linelen = textptr - linestart;
 				lastspace = NULL;
@@ -137,6 +137,6 @@  fwts_list *fwts_format_text(const char *text, const int width)
 	fwts_text_list_append(list, tmp);
 	free(tmp);
 	free(tidied_text);
-	
+
 	return list;
 }
diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
index f53bbf2..c6536a6 100644
--- a/src/lib/src/fwts_framework.c
+++ b/src/lib/src/fwts_framework.c
@@ -92,7 +92,7 @@  typedef struct {
 
 static const char *fwts_copyright[] = {
 	"Some of this work - Copyright (c) 1999 - 2010, Intel Corp. All rights reserved.",
-	"Some of this work - Copyright (c) 2010 - 2012, Canonical.",	
+	"Some of this work - Copyright (c) 2010 - 2012, Canonical.",
 	NULL
 };
 
@@ -191,14 +191,14 @@  static void fwts_framework_show_tests_brief(fwts_framework *fw)
 			fwts_framework_compare_test_name);
 	}
 
-	fwts_list_foreach(item, &sorted) {		
+	fwts_list_foreach(item, &sorted) {
 		fwts_framework_test *test = fwts_list_data(fwts_framework_test*, item);
 		int len = strlen(test->name) + 1;
 		if ((n + len) > width)  {
 			fprintf(stderr, "\n");
 			n = 0;
 		}
-				
+
 		fprintf(stderr, "%s ", test->name);
 		n += len;
 	}
@@ -255,7 +255,7 @@  static void fwts_framework_show_tests(fwts_framework *fw, bool full)
 				need_nl = 1;
 				printf("%s%s:\n", categories[i].title,
 					categories[i].flag & FWTS_UTILS ? "" : " tests");
-	
+
 				fwts_list_foreach(item, &sorted) {
 					test = fwts_list_data(fwts_framework_test *, item);
 					if (full) {
@@ -268,7 +268,7 @@  static void fwts_framework_show_tests(fwts_framework *fw, bool full)
 						total += test->ops->total_tests;
 					}
 					else {
-						printf(" %-13.13s %s\n", test->name, 
+						printf(" %-13.13s %s\n", test->name,
 							test->ops->description ? test->ops->description : "");
 					}
 				}
@@ -392,7 +392,7 @@  void fwts_framework_minor_test_progress(fwts_framework *fw, const int percent, c
 		fprintf(stdout, "XXX\n");
 		fprintf(stdout, "%d\n", (int)progress);
 		fprintf(stdout, "So far: %s\n\n", buffer);
-		fprintf(stdout, "%s\n\n", fw->current_major_test->ops->description ? 
+		fprintf(stdout, "%s\n\n", fw->current_major_test->ops->description ?
 			fw->current_major_test->ops->description : "");
 		fprintf(stdout, "Running test #%d: %s\n",
 			fw->current_major_test_num,
@@ -462,8 +462,8 @@  static int fwts_framework_total_summary(fwts_framework *fw)
 }
 
 static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts_framework_test *test)
-{		
-	fwts_framework_minor_test *minor_test;	
+{
+	fwts_framework_minor_test *minor_test;
 	int ret;
 
 	fw->current_major_test = test;
@@ -512,7 +512,7 @@  static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts
 		goto done;
 	}
 
-	if ((test->ops->init) && 
+	if ((test->ops->init) &&
 	    ((ret = test->ops->init(fw)) != FWTS_OK)) {
 		char *msg = NULL;
 
@@ -535,8 +535,8 @@  static int fwts_framework_run_test(fwts_framework *fw, const int num_tests, fwts
 	}
 
 	fwts_log_section_begin(fw->results, "subtests");
-	for (minor_test = test->ops->minor_tests; 
-		*minor_test->test_func != NULL; 
+	for (minor_test = test->ops->minor_tests;
+		*minor_test->test_func != NULL;
 		minor_test++, fw->current_minor_test_num++) {
 
 		fwts_log_section_begin(fw->results, "subtest");
@@ -613,7 +613,7 @@  done:
 
 /*
  *  fwts_framework_tests_run()
- *	
+ *
  */
 static void fwts_framework_tests_run(fwts_framework *fw, fwts_list *tests_to_run)
 {
@@ -636,7 +636,7 @@  static void fwts_framework_tests_run(fwts_framework *fw, fwts_list *tests_to_run
 static fwts_framework_test *fwts_framework_test_find(fwts_framework *fw, const char *name)
 {
 	fwts_list_link *item;
-	
+
 	fwts_list_foreach(item, &fwts_framework_test_list) {
 		fwts_framework_test *test = fwts_list_data(fwts_framework_test *, item);
 		if (strcmp(name, test->name) == 0)
@@ -667,7 +667,7 @@  void fwts_framework_log(fwts_framework *fw,
 		va_start(ap, fmt);
 		vsnprintf(buffer, sizeof(buffer), fmt, ap);
 		va_end(ap);
-	} else 
+	} else
 		*buffer = '\0';
 
 	if (count)
@@ -737,10 +737,10 @@  static void fwts_framework_syntax(char * const *argv)
 	printf("Usage %s: [OPTION] [TEST]\n", argv[0]);
 
 	fwts_args_show_options();
-	
+
 	/* Tag on copyright info */
 	printf("\n");
-	for (i=0; fwts_copyright[i]; i++) 
+	for (i=0; fwts_copyright[i]; i++)
 		printf("%s\n", fwts_copyright[i]);
 }
 
@@ -774,7 +774,7 @@  static void fwts_framework_heading_info(fwts_framework *fw, fwts_list *tests_to_
 		tm.tm_hour, tm.tm_min, tm.tm_sec,
 		buf.sysname, buf.nodename, buf.release, buf.version, buf.machine);
 	fwts_log_nl(fw);
-	
+
 	fwts_list_foreach(item, tests_to_run) {
 		fwts_framework_test *test = fwts_list_data(fwts_framework_test *, item);
 		len += strlen(test->name) + 1;
@@ -873,7 +873,7 @@  int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
 		switch (long_index) {
 		case 0: /* --stdout-summary */
 			fw->flags |= FWTS_FRAMEWORK_FLAGS_STDOUT_SUMMARY;
-			break;	
+			break;
 		case 1: /* --help */
 			fwts_framework_syntax(argv);
 			return FWTS_COMPLETE;
@@ -892,7 +892,7 @@  int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
 			return FWTS_COMPLETE;
 		case 6: /* --log-format */
 			fwts_log_set_format(optarg);
-			break;	
+			break;
 		case 7: /* --show-progress */
 			fw->flags = (fw->flags &
 					~(FWTS_FRAMEWORK_FLAGS_QUIET |
@@ -1147,7 +1147,7 @@  int fwts_framework_args(const int argc, char **argv)
 
 	/* Results log */
 	if ((fw->results = fwts_log_open("fwts",
-			fw->results_logname,	
+			fw->results_logname,
 			fw->flags & FWTS_FRAMEWORK_FLAGS_FORCE_CLEAN ? "w" : "a",
 			fw->log_type)) == NULL) {
 		ret = FWTS_ERROR;
@@ -1186,7 +1186,7 @@  int fwts_framework_args(const int argc, char **argv)
 
 	if (!(fw->flags & FWTS_FRAMEWORK_FLAGS_QUIET)) {
 		char *filenames = fwts_log_get_filenames(fw->results_logname, fw->log_type);
-		
+
 		if (filenames) {
 			printf("Running %d tests, results appended to %s\n",
 				fwts_list_len(&tests_to_run),
@@ -1236,10 +1236,10 @@  tidy_close:
 	fwts_list_free_items(&fwts_framework_test_list, free);
 
 	/* Failed tests flagged an error */
-	if ((fw->total.failed > 0) || (fw->total.warning > 0))	
+	if ((fw->total.failed > 0) || (fw->total.warning > 0))
 		ret = FWTS_ERROR;
 
 	free(fw);
-	
+
 	return ret;
 }
diff --git a/src/lib/src/fwts_get.c b/src/lib/src/fwts_get.c
index 107e3c7..be56eca 100644
--- a/src/lib/src/fwts_get.c
+++ b/src/lib/src/fwts_get.c
@@ -23,26 +23,25 @@ 
 
 #include "fwts.h"
 
-
 /*
  *  fwts_get()
  *	get a string from a file. used to gather text from /proc or /sys entries
  */
 char *fwts_get(const char *file)
-{	
+{
 	FILE *fp;
 	char buffer[4096];
 
 	if ((fp = fopen(file, "r")) == NULL)
 		return NULL;
-	
+
 	if (fgets(buffer, sizeof(buffer), fp) == NULL) {
 		fclose(fp);
 		return NULL;
 	}
 
 	fclose(fp);
-	
+
 	return strdup(buffer);
 }
 
@@ -55,7 +54,7 @@  int fwts_get_int(const char *file, int *value)
 	char *data;
 
 	*value = 0;
-	
+
 	if ((data = fwts_get(file)) == NULL) {
 		*value = 0;
 		return FWTS_ERROR;
diff --git a/src/lib/src/fwts_gpe.c b/src/lib/src/fwts_gpe.c
index 00b058b..df7ba2a 100644
--- a/src/lib/src/fwts_gpe.c
+++ b/src/lib/src/fwts_gpe.c
@@ -58,7 +58,7 @@  int fwts_gpe_read(fwts_gpe **gpes)
 
 	if ((dir = opendir(FWTS_GPE_PATH)) == NULL)
 		return FWTS_ERROR;
-	
+
 	while ((entry = readdir(dir)) != NULL) {
 		if ((strncmp(entry->d_name, "gpe", 3) == 0) ||
 		    (strncmp(entry->d_name, "sci",3) == 0)) {
@@ -70,7 +70,7 @@  int fwts_gpe_read(fwts_gpe **gpes)
 
 				if (((*gpes)[n].name  = strdup(entry->d_name)) == NULL)
 					goto error;
-				
+
 				snprintf(path, sizeof(path), "%s/%s", FWTS_GPE_PATH, entry->d_name);
 				if ((data = fwts_get(path)) != NULL) {
 					(*gpes)[n].count = atoi(data);
@@ -99,7 +99,7 @@  error:
  * 	update the result in gpe_delta.
  */
 int fwts_gpe_delta(int **gpe_delta, const fwts_gpe *start, const fwts_gpe *end, const int n)
-{	
+{
 	int i;
 	if (((*gpe_delta) = calloc(n, sizeof(int))) == NULL)
 		return FWTS_ERROR;
@@ -162,7 +162,7 @@  void fwts_gpe_test(fwts_framework *fw, const fwts_gpe *gpes_start, const fwts_gp
 		}
 	}
 	free(deltas);
-	
+
 	if (sci == 0)
 		fwts_failed(fw, LOG_LEVEL_HIGH, "NoSCIInterrupts", "Did not detect any SCI interrupts.");
 
diff --git a/src/lib/src/fwts_guid.c b/src/lib/src/fwts_guid.c
index a532170..510cb25 100644
--- a/src/lib/src/fwts_guid.c
+++ b/src/lib/src/fwts_guid.c
@@ -28,7 +28,7 @@ 
  */
 void fwts_guid_buf_to_str(uint8_t *guid, char *guid_str, size_t guid_str_len)
 {
-	if (guid_str && guid_str_len > 36) 
+	if (guid_str && guid_str_len > 36)
         	snprintf(guid_str, guid_str_len, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
 			guid[3], guid[2], guid[1], guid[0], guid[5], guid[4], guid[7], guid[6],
 			guid[8], guid[9], guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]);
diff --git a/src/lib/src/fwts_hwinfo.c b/src/lib/src/fwts_hwinfo.c
index 86d014e..b540b98 100644
--- a/src/lib/src/fwts_hwinfo.c
+++ b/src/lib/src/fwts_hwinfo.c
@@ -23,7 +23,7 @@ 
 
 /*
  *  fwts_hwinfo_get()
- *	gather H/W information 
+ *	gather H/W information
  */
 int fwts_hwinfo_get(fwts_framework *fw, fwts_hwinfo *hwinfo)
 {
diff --git a/src/lib/src/fwts_iasl.c b/src/lib/src/fwts_iasl.c
index 736a4e3..9b3b873 100644
--- a/src/lib/src/fwts_iasl.c
+++ b/src/lib/src/fwts_iasl.c
@@ -52,7 +52,7 @@  static int fwts_iasl_dump_aml_to_file(fwts_framework *fw,
 		close(fd);
 		(void)unlink(amlfile);
 		return FWTS_ERROR;
-	}	
+	}
 	close(fd);
 
 	return FWTS_OK;
@@ -166,7 +166,7 @@  int fwts_iasl_disassemble_all_to_file(fwts_framework *fw)
  * 	any re-assembly errors into list iasl_errors.
  */
 int fwts_iasl_reassemble(fwts_framework *fw,
-	const uint8_t *data, 
+	const uint8_t *data,
 	const int len,
 	fwts_list **iasl_disassembly,
 	fwts_list **iasl_errors)
diff --git a/src/lib/src/fwts_interactive.c b/src/lib/src/fwts_interactive.c
index 2b424b5..07d3f39 100644
--- a/src/lib/src/fwts_interactive.c
+++ b/src/lib/src/fwts_interactive.c
@@ -37,7 +37,7 @@  static int fwts_getchar(int *ch)
 
 	*ch = -1;
 
-	if (tcgetattr(fd, &oldterm) < 0) 
+	if (tcgetattr(fd, &oldterm) < 0)
 		return FWTS_ERROR;
 
 	memcpy(&newterm, &oldterm, sizeof(struct termios));
@@ -49,8 +49,8 @@  static int fwts_getchar(int *ch)
 		return FWTS_ERROR;
 
 	*ch = getchar();
-	
-	if (tcsetattr(fd, TCSANOW, &oldterm) < 0) 
+
+	if (tcsetattr(fd, TCSANOW, &oldterm) < 0)
 		return FWTS_ERROR;
 
 	return FWTS_OK;
@@ -83,7 +83,7 @@  int fwts_press_enter(fwts_framework *fw)
 
 	fprintf(stdout, "Press <Enter> to continue");
 	fflush(stdout);
-	
+
 	do {
 		if (fwts_getchar(&ch) == FWTS_ERROR) {
 			fwts_log_error(fw, "fwts_getchar() failed.");
@@ -93,7 +93,7 @@  int fwts_press_enter(fwts_framework *fw)
 
 	fprintf(stdout, "\n");
 	fflush(stdout);
-	
+
 	return FWTS_OK;
 }
 
@@ -111,7 +111,7 @@  int fwts_get_reply(fwts_framework *fw, const char *message, const char *options)
 	for (;;) {
 
 		if (fwts_getchar(&ch) == FWTS_ERROR) {
-			fwts_log_error(fw, "fwts_getchar() failed.");	
+			fwts_log_error(fw, "fwts_getchar() failed.");
 			break;
 		}
 		if (index(options, ch) != NULL)
diff --git a/src/lib/src/fwts_keymap.c b/src/lib/src/fwts_keymap.c
index 10c5e3b..b60c331 100644
--- a/src/lib/src/fwts_keymap.c
+++ b/src/lib/src/fwts_keymap.c
@@ -51,7 +51,7 @@  void fwts_keymap_free(fwts_list *keylist)
  *	in a list of keymap items.
  */
 fwts_list *fwts_keymap_load(const char *machine)
-{	
+{
 	FILE *fp;
 	char buffer[4096];
 	char path[PATH_MAX];
@@ -59,7 +59,7 @@  fwts_list *fwts_keymap_load(const char *machine)
 
 	if ((keymap_list = fwts_list_new()) == NULL)
 		return NULL;
-	
+
 	snprintf(path, sizeof(path), "%s/%s", FWTS_KEYMAP_PATH, machine);
 
 	if ((fp = fopen(path, "r")) == NULL)
@@ -116,7 +116,7 @@  fwts_list *fwts_keymap_load(const char *machine)
 	}
 
 	fclose(fp);
-	
+
 	return keymap_list;
 }
 
diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
index 7b7fb41..93dbb06 100644
--- a/src/lib/src/fwts_klog.c
+++ b/src/lib/src/fwts_klog.c
@@ -68,7 +68,7 @@  fwts_list *fwts_klog_read(void)
 
 	if ((buffer = calloc(1, len)) == NULL)
 		return NULL;
-	
+
 	if (klogctl(3, buffer, len) < 0) {
 		free(buffer);
 		return NULL;
@@ -76,7 +76,7 @@  fwts_list *fwts_klog_read(void)
 
 	list = fwts_list_from_text(buffer);
 	free(buffer);
-	
+
 	return list;
 }
 
@@ -131,10 +131,10 @@  int fwts_klog_scan(fwts_framework *fw,
 		if (*newline) {
 			int matched = 0;
 			fwts_list_link *l;
-			fwts_list_foreach(l, klog_reduced) {	
+			fwts_list_foreach(l, klog_reduced) {
 				char *line;
 				klog_reduced_item *reduced = fwts_list_data(klog_reduced_item *, l);
-				
+
 				line = fwts_klog_remove_timestamp(reduced->line);
 				if (strcmp(newline, line) == 0) {
 					reduced->repeated++;
@@ -144,7 +144,7 @@  int fwts_klog_scan(fwts_framework *fw,
 			}
 			if (!matched) {
 				klog_reduced_item *new;
-	
+
 				if ((new = calloc(1, sizeof(klog_reduced_item))) == NULL) {
 					fwts_list_free(klog_reduced, free);
 					return FWTS_ERROR;
@@ -272,7 +272,7 @@  static fwts_compare_mode fwts_klog_compare_mode_str_to_val(const char *str)
 	else
 		return FWTS_COMPARE_UNKNOWN;
 }
-		
+
 #define JSON_ERROR	((json_object*)-1)
 
 /*
@@ -311,12 +311,12 @@  static int fwts_klog_check(fwts_framework *fw,
 		fwts_log_error(fw, "Cannot load klog data from %s.", json_data_path);
 		return FWTS_ERROR;
 	}
-		
+
 	if ((klog_table = json_object_object_get(klog_objs, table)) == JSON_ERROR) {
 		fwts_log_error(fw, "Cannot fetch klog table object '%s' from %s.", table, json_data_path);
 		goto fail_put;
 	}
-		
+
 	n = json_object_array_length(klog_table);
 
 	/* Last entry is null to indicate end, so alloc n+1 items */
@@ -367,13 +367,13 @@  fail:
 	free(patterns);
 fail_put:
 	json_object_put(klog_objs);
-	
+
 	return ret;
 }
 
 int fwts_klog_firmware_check(fwts_framework *fw, fwts_klog_progress_func progress,
 	fwts_list *klog, int *errors)
-{	
+{
 	return fwts_klog_check(fw, "firmware_error_warning_patterns",
 		progress, klog, errors);
 }
diff --git a/src/lib/src/fwts_log.c b/src/lib/src/fwts_log.c
index 55ebd06..6ed32c1 100644
--- a/src/lib/src/fwts_log.c
+++ b/src/lib/src/fwts_log.c
@@ -219,7 +219,6 @@  void fwts_log_print_fields(void)
 	printf("\n");
 }
 
-
 /*
  *  fwts_log_str_to_field()
  *	return log field of a given string, 0 if not matching
diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
index a0ca16f..8b29315 100644
--- a/src/lib/src/fwts_memorymap.c
+++ b/src/lib/src/fwts_memorymap.c
@@ -100,7 +100,7 @@  static int fwts_register_memory_map_line(fwts_list *memory_map_list, const uint6
 
 	if ((entry = calloc(1, sizeof(fwts_memory_map_entry))) == NULL)
 		return FWTS_ERROR;
-	
+
 	entry->start_address = start;
 	entry->end_address   = end;
 	entry->type          = type;
@@ -153,7 +153,7 @@  fwts_bool fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_t
 	/* when we don't have FWTS_MEMORY_MAP info, assume all is fair */
 	if (memory_map_list == NULL)
 		return FWTS_TRUE;
-	
+
 	/* bios data area is always reserved */
 	if ((memory >= 640 * 1024) && (memory <= 1024*1024))
 		return FWTS_TRUE;
@@ -233,7 +233,7 @@  fwts_list *fwts_memory_map_table_load_from_klog(fwts_framework *fw)
 
 	if ((memory_map_list = fwts_list_new()) == NULL)
 		return NULL;
-	
+
 	fwts_list_iterate(klog, fwts_memory_map_dmesg_info, memory_map_list);
 	fwts_klog_free(klog);
 
@@ -268,7 +268,7 @@  static fwts_memory_map_entry *fwts_memory_map_table_read_entry(const char *which
 	}
 	sscanf(data, "0x%llx", (unsigned long long*)&entry->end_address);
 	free(data);
-	
+
 	snprintf(path, sizeof(path), "/sys/firmware/memmap/%s/type", which);
 	if ((data = fwts_get(path)) == NULL) {
 		free(entry);
diff --git a/src/lib/src/fwts_microcode.c b/src/lib/src/fwts_microcode.c
index b3784ef..209cf29 100644
--- a/src/lib/src/fwts_microcode.c
+++ b/src/lib/src/fwts_microcode.c
@@ -110,7 +110,7 @@  int fwts_update_microcode(fwts_framework *fw, const char *device, const char *fi
 		return FWTS_ERROR;
 	}
 
-	close(fd);	
+	close(fd);
 	free(microcode);
 
 	return FWTS_OK;
diff --git a/src/lib/src/fwts_multiproc.c b/src/lib/src/fwts_multiproc.c
index 693ff5a..01f4561 100644
--- a/src/lib/src/fwts_multiproc.c
+++ b/src/lib/src/fwts_multiproc.c
@@ -79,7 +79,7 @@  static int fwts_mp_get_address(uint32_t *phys_addr)
 			continue;
 
 		for (ptr = mem; ptr < (uint8_t*)(mem + size); ptr+=16) {
-			if ((*ptr == '_') && 
+			if ((*ptr == '_') &&
 			    (*(ptr + 1) == 'M') &&
 			    (*(ptr + 2) == 'P') &&
 			    (*(ptr + 3) == '_')) {
@@ -100,7 +100,7 @@  static int fwts_mp_get_address(uint32_t *phys_addr)
 	return FWTS_ERROR;
 }
 
-/* 
+/*
  *  fwts_mp_data_get()
  *	find _MP_ data, map in header and table,
  *	collect up entries into a list
@@ -128,7 +128,7 @@  int fwts_mp_data_get(fwts_mp_data *data)
 	header = (fwts_mp_config_table_header *)mem;
 	fwts_list_init(&data->entries);
 
-	data->size = header->base_table_length + 
+	data->size = header->base_table_length +
 		((header->spec_rev == 1) ? 0 : header->extended_table_length);
 
 	/* Remap with full header and table now we know how big it is */
@@ -185,7 +185,7 @@  int fwts_mp_data_get(fwts_mp_data *data)
 
 /*
  *  fwts_mp_data_free()
- *	free entries and unmap 
+ *	free entries and unmap
  */
 int fwts_mp_data_free(fwts_mp_data *data)
 {
diff --git a/src/lib/src/fwts_oops.c b/src/lib/src/fwts_oops.c
index df9c3c7..fe557e5 100644
--- a/src/lib/src/fwts_oops.c
+++ b/src/lib/src/fwts_oops.c
@@ -54,7 +54,7 @@  void fwts_oops_dump(fwts_framework *fw, fwts_list_link *bug_item, int *oopses)
 			dumpable |= FWTS_OOPS_GOT_STACK;
 		if (strstr(line, "Call Trace:"))
 			dumpable |= FWTS_OOPS_GOT_CALL_TRACE;
-		if (strstr(line, "--[ end trace")) { 
+		if (strstr(line, "--[ end trace")) {
 			dumpable |= FWTS_OOPS_GOT_END_TRACE;
 			break;
 		}
@@ -80,7 +80,7 @@  void fwts_oops_dump(fwts_framework *fw, fwts_list_link *bug_item, int *oopses)
 		fwts_log_info(fw, "Found OOPS (%d):", *oopses);
 
 		while (bug_item != NULL && bug_item != item) {
-			fwts_log_info_verbatum(fw, "  %s", 
+			fwts_log_info_verbatum(fw, "  %s",
 				fwts_klog_remove_timestamp(fwts_list_data(char *, bug_item)));
 			bug_item = bug_item->next;
 		}
diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
index d4abfd5..cb6bd1e 100644
--- a/src/lib/src/fwts_pipeio.c
+++ b/src/lib/src/fwts_pipeio.c
@@ -41,7 +41,7 @@  int fwts_pipe_open(const char *command, pid_t *childpid)
 {
 	int pipefds[2];
 	pid_t pid;
-	
+
 	if (pipe(pipefds) < 0)
 		return -1;
 
@@ -68,7 +68,7 @@  int fwts_pipe_open(const char *command, pid_t *childpid)
 		/* Parent */
 		close(pipefds[1]);
 		*childpid = pid;
-	
+
 		return pipefds[0];
 	}
 }
@@ -82,7 +82,7 @@  int fwts_pipe_open(const char *command, pid_t *childpid)
 char *fwts_pipe_read(const int fd, ssize_t *length)
 {
 	char *ptr = NULL;
-	char buffer[8192];	
+	char buffer[8192];
 	ssize_t n;
 	ssize_t size = 0;
 	*length = 0;
diff --git a/src/lib/src/fwts_set.c b/src/lib/src/fwts_set.c
index 657d25c..e4b0e0c 100644
--- a/src/lib/src/fwts_set.c
+++ b/src/lib/src/fwts_set.c
@@ -28,14 +28,14 @@ 
  *	values in /sys or /proc
  */
 int fwts_set(const char *text, const char *file)
-{	
+{
 	FILE *fp;
 
 	if ((fp = fopen(file, "w")) == NULL)
 		return FWTS_ERROR;
 
 	fprintf(fp, "%s\n", text);
-	fclose(fp);	
+	fclose(fp);
 
 	return FWTS_OK;
 }
diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
index ef6d076..b9c4540 100644
--- a/src/lib/src/fwts_smbios.c
+++ b/src/lib/src/fwts_smbios.c
@@ -35,7 +35,7 @@  static void *fwts_smbios_find_entry_uefi(fwts_framework *fw, fwts_smbios_entry *
 			return NULL;
 		}
 		*entry = *mapped_entry;
-		*type  = FWTS_SMBIOS;	
+		*type  = FWTS_SMBIOS;
 		(void)fwts_munmap(mapped_entry, sizeof(fwts_smbios_entry));
 	}
 	return addr;
@@ -61,19 +61,19 @@  static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
 		if ((*(mem+i)   == '_') &&
 		    (*(mem+i+1) == 'S') &&
 		    (*(mem+i+2) == 'M') &&
-		    (*(mem+i+3) == '_') && 
+		    (*(mem+i+3) == '_') &&
 		    (fwts_checksum(mem + i, 16) == 0)) {
 			addr = (void*)FWTS_SMBIOS_REGION_START + i;
 			memcpy(entry, (void*)(mem + i), sizeof(fwts_smbios_entry));
-			*type  = FWTS_SMBIOS;	
+			*type  = FWTS_SMBIOS;
 			break;
 		}
 		/* Legacy DMI entry point */
 		if ((*(mem+i)   == '_') &&
 		    (*(mem+i+1) == 'D') &&
 		    (*(mem+i+2) == 'M') &&
-		    (*(mem+i+3) == 'I') && 
-		    (*(mem+i+4) == '_') && 
+		    (*(mem+i+3) == 'I') &&
+		    (*(mem+i+4) == '_') &&
 		    (fwts_checksum(mem + i, 15) == 0)) {
 			memset(entry, 0, 16);
 			addr = (void*)FWTS_SMBIOS_REGION_START + i;
@@ -82,7 +82,6 @@  static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
 			break;
 		}
 	}
-			
 
         (void)fwts_munmap(mem, FWTS_SMBIOS_REGION_SIZE);
 
@@ -91,7 +90,7 @@  static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
 
 /*
  *  fwts_smbios_find_entry()
- *	find SMBIOS structure table entry 
+ *	find SMBIOS structure table entry
  */
 void *fwts_smbios_find_entry(fwts_framework *fw,
 	fwts_smbios_entry *entry,
@@ -119,7 +118,6 @@  void *fwts_smbios_find_entry(fwts_framework *fw,
 				break;
 			}
 		}
-	
 	}
 	return addr;
 }
diff --git a/src/lib/src/fwts_tag.c b/src/lib/src/fwts_tag.c
index 38d1449..d8e9dad 100644
--- a/src/lib/src/fwts_tag.c
+++ b/src/lib/src/fwts_tag.c
@@ -82,7 +82,6 @@  static fwts_tag_info fwts_tags[] = {
 	{ 0, NULL, NULL }
 };
 
-
 /*
  *  fwts_tag_id_str_to_tag()
  *	given a tag string, return the tag
diff --git a/src/lib/src/fwts_text_list.c b/src/lib/src/fwts_text_list.c
index 373fe19..4e02f0e 100644
--- a/src/lib/src/fwts_text_list.c
+++ b/src/lib/src/fwts_text_list.c
@@ -115,6 +115,6 @@  fwts_list *fwts_list_from_text(const char *text)
 
 		fwts_list_append(list, str);
 	}
-	
+
 	return list;
 }
diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
index 9a125f5..d4f68f4 100644
--- a/src/lib/src/fwts_uefi.c
+++ b/src/lib/src/fwts_uefi.c
@@ -27,7 +27,6 @@ 
 #include "fwts.h"
 #include "fwts_uefi.h"
 
-
 static inline void fwts_uefi_set_filename(char *filename, const int len, const char *varname)
 {
 	snprintf(filename, len, "/sys/firmware/efi/vars/%s/raw_var", varname);
@@ -42,7 +41,7 @@  void fwts_uefi_str16_to_str(char *dst, const size_t len, const uint16_t *src)
 	size_t i = len;
 
 	while ((*src) && (i > 1)) {
-		*dst++ = *(src++) & 0xff;		
+		*dst++ = *(src++) & 0xff;
 		i--;
 	}
 	*dst = '\0';
@@ -86,7 +85,7 @@  int fwts_uefi_get_variable(const char *varname, fwts_uefi_var *var)
 
 	fwts_uefi_set_filename(filename, sizeof(filename), varname);
 
-	if ((fd = open(filename, O_RDONLY)) < 0) 
+	if ((fd = open(filename, O_RDONLY)) < 0)
 		return FWTS_ERROR;
 
 	memset(var, 0, sizeof(fwts_uefi_var));
@@ -115,7 +114,7 @@  int fwts_uefi_set_variable(const char *varname, fwts_uefi_var *var)
 
 	fwts_uefi_set_filename(filename, sizeof(filename), varname);
 
-	if ((fd = open(filename, O_WRONLY)) < 0) 
+	if ((fd = open(filename, O_WRONLY)) < 0)
 		return FWTS_ERROR;
 
 	if ((n = write(fd, var, sizeof(fwts_uefi_var))) != sizeof(fwts_uefi_var))
diff --git a/src/lib/src/fwts_virt.c b/src/lib/src/fwts_virt.c
index 22ebc79..ad5bec0 100644
--- a/src/lib/src/fwts_virt.c
+++ b/src/lib/src/fwts_virt.c
@@ -59,7 +59,7 @@  void fwts_exec_cpuid(const int cpu, const uint32_t cmd, cpu_registers* regs)
 			   : "a"(cmd)
 	);
 #endif
-	
+
 	if (cpu != CURRENT_CPU)
 		sched_setaffinity(0, sizeof(oldmask), &oldmask);
 }
diff --git a/src/lib/src/fwts_wakealarm.c b/src/lib/src/fwts_wakealarm.c
index 56d4317..a93e34a 100644
--- a/src/lib/src/fwts_wakealarm.c
+++ b/src/lib/src/fwts_wakealarm.c
@@ -41,14 +41,14 @@  int fwts_wakealarm_get_irq_state(void)
 	if ((fp = fopen("/proc/driver/rtc", "r")) == NULL)
 		return FWTS_ERROR;
 
-	while (fscanf(fp, "%s : %s\n", field, value) != EOF) {	
+	while (fscanf(fp, "%s : %s\n", field, value) != EOF) {
 		if (!strcmp(field, "alarm_IRQ")) {
 			fclose(fp);
 			return strcmp(value, "no");
 		}
 	}
 	fclose(fp);
-	
+
 	return FWTS_ERROR;
 }