Patchwork [18/26] bios: dmi_decode: remove redundant parameters from helper functions

login
register
mail settings
Submitter Colin King
Date Oct. 14, 2012, 8:32 p.m.
Message ID <1350246738-31699-19-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/191409/
State Accepted
Headers show

Comments

Colin King - Oct. 14, 2012, 8:32 p.m.
From: Colin Ian King <colin.king@canonical.com>

Functions  dmi_uuid_check and dmi_scan_tables have redundant parameters
so remove them.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/dmi/dmi_decode/dmi_decode.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
Alex Hung - Oct. 15, 2012, 5:59 a.m.
On 10/15/2012 04:32 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Functions  dmi_uuid_check and dmi_scan_tables have redundant parameters
> so remove them.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/dmi/dmi_decode/dmi_decode.c |   15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/src/dmi/dmi_decode/dmi_decode.c b/src/dmi/dmi_decode/dmi_decode.c
> index f502713..ca307ef 100644
> --- a/src/dmi/dmi_decode/dmi_decode.c
> +++ b/src/dmi/dmi_decode/dmi_decode.c
> @@ -405,8 +405,7 @@ static void dmi_uuid_check(fwts_framework *fw,
>   	uint32_t addr,
>   	const char *field,
>   	const fwts_dmi_header *hdr,
> -	uint8_t offset,
> -	uint16_t version)
> +	uint8_t offset)
>   {
>   	char guid_str[37];
>   	int i;
> @@ -434,8 +433,7 @@ static void dmi_uuid_check(fwts_framework *fw,
>
>   static void dmi_decode_entry(fwts_framework *fw,
>   	uint32_t addr,
> -	const fwts_dmi_header *hdr,
> -	uint16_t version)
> +	const fwts_dmi_header *hdr)
>   {
>   	uint8_t *ptr;
>   	uint8_t count;
> @@ -473,7 +471,7 @@ static void dmi_decode_entry(fwts_framework *fw,
>   			dmi_str_check(fw, table, addr, "Serial Number", hdr, 0x7);
>   			if (hdr->length < 0x19)
>   				break;
> -			dmi_uuid_check(fw, table, addr, "UUID", hdr, 0x8, version);
> +			dmi_uuid_check(fw, table, addr, "UUID", hdr, 0x8);
>   			dmi_min_max_uint8_check(fw, table, addr, "Wakeup Type", hdr, 0x18, 0x0, 0x08);
>   			if (hdr->length < 0x1b)
>   				break;
> @@ -1178,8 +1176,7 @@ static int dmi_version_check(fwts_framework *fw, uint16_t version)
>
>   static void dmi_scan_tables(fwts_framework *fw,
>   	fwts_smbios_entry *entry,
> -	uint8_t  *table,
> -	uint16_t version)
> +	uint8_t  *table)
>   {
>   	uint8_t *entry_data = table;
>   	uint16_t table_length;
> @@ -1226,7 +1223,7 @@ static void dmi_scan_tables(fwts_framework *fw,
>   		next_entry += 2;
>
>   		if ((next_entry - table) <= table_length)
> -			dmi_decode_entry(fw, addr, &hdr, version);
> +			dmi_decode_entry(fw, addr, &hdr);
>
>   		i++;
>   		entry_data = next_entry;
> @@ -1280,7 +1277,7 @@ static int dmi_decode_test1(fwts_framework *fw)
>   		return FWTS_ERROR;
>   	}
>
> -	dmi_scan_tables(fw, &entry, table, version);
> +	dmi_scan_tables(fw, &entry, table);
>
>   	(void)fwts_munmap(table, (size_t)entry.struct_table_length);
>
>

Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - Oct. 17, 2012, 7:52 a.m.
On Mon, Oct 15, 2012 at 4:32 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Functions  dmi_uuid_check and dmi_scan_tables have redundant parameters
> so remove them.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/dmi/dmi_decode/dmi_decode.c |   15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/src/dmi/dmi_decode/dmi_decode.c b/src/dmi/dmi_decode/dmi_decode.c
> index f502713..ca307ef 100644
> --- a/src/dmi/dmi_decode/dmi_decode.c
> +++ b/src/dmi/dmi_decode/dmi_decode.c
> @@ -405,8 +405,7 @@ static void dmi_uuid_check(fwts_framework *fw,
>         uint32_t addr,
>         const char *field,
>         const fwts_dmi_header *hdr,
> -       uint8_t offset,
> -       uint16_t version)
> +       uint8_t offset)
>  {
>         char guid_str[37];
>         int i;
> @@ -434,8 +433,7 @@ static void dmi_uuid_check(fwts_framework *fw,
>
>  static void dmi_decode_entry(fwts_framework *fw,
>         uint32_t addr,
> -       const fwts_dmi_header *hdr,
> -       uint16_t version)
> +       const fwts_dmi_header *hdr)
>  {
>         uint8_t *ptr;
>         uint8_t count;
> @@ -473,7 +471,7 @@ static void dmi_decode_entry(fwts_framework *fw,
>                         dmi_str_check(fw, table, addr, "Serial Number", hdr, 0x7);
>                         if (hdr->length < 0x19)
>                                 break;
> -                       dmi_uuid_check(fw, table, addr, "UUID", hdr, 0x8, version);
> +                       dmi_uuid_check(fw, table, addr, "UUID", hdr, 0x8);
>                         dmi_min_max_uint8_check(fw, table, addr, "Wakeup Type", hdr, 0x18, 0x0, 0x08);
>                         if (hdr->length < 0x1b)
>                                 break;
> @@ -1178,8 +1176,7 @@ static int dmi_version_check(fwts_framework *fw, uint16_t version)
>
>  static void dmi_scan_tables(fwts_framework *fw,
>         fwts_smbios_entry *entry,
> -       uint8_t  *table,
> -       uint16_t version)
> +       uint8_t  *table)
>  {
>         uint8_t *entry_data = table;
>         uint16_t table_length;
> @@ -1226,7 +1223,7 @@ static void dmi_scan_tables(fwts_framework *fw,
>                 next_entry += 2;
>
>                 if ((next_entry - table) <= table_length)
> -                       dmi_decode_entry(fw, addr, &hdr, version);
> +                       dmi_decode_entry(fw, addr, &hdr);
>
>                 i++;
>                 entry_data = next_entry;
> @@ -1280,7 +1277,7 @@ static int dmi_decode_test1(fwts_framework *fw)
>                 return FWTS_ERROR;
>         }
>
> -       dmi_scan_tables(fw, &entry, table, version);
> +       dmi_scan_tables(fw, &entry, table);
>
>         (void)fwts_munmap(table, (size_t)entry.struct_table_length);
>
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/dmi/dmi_decode/dmi_decode.c b/src/dmi/dmi_decode/dmi_decode.c
index f502713..ca307ef 100644
--- a/src/dmi/dmi_decode/dmi_decode.c
+++ b/src/dmi/dmi_decode/dmi_decode.c
@@ -405,8 +405,7 @@  static void dmi_uuid_check(fwts_framework *fw,
 	uint32_t addr,
 	const char *field,
 	const fwts_dmi_header *hdr,
-	uint8_t offset,
-	uint16_t version)
+	uint8_t offset)
 {
 	char guid_str[37];
 	int i;
@@ -434,8 +433,7 @@  static void dmi_uuid_check(fwts_framework *fw,
 
 static void dmi_decode_entry(fwts_framework *fw,
 	uint32_t addr,
-	const fwts_dmi_header *hdr,
-	uint16_t version)
+	const fwts_dmi_header *hdr)
 {
 	uint8_t *ptr;
 	uint8_t count;
@@ -473,7 +471,7 @@  static void dmi_decode_entry(fwts_framework *fw,
 			dmi_str_check(fw, table, addr, "Serial Number", hdr, 0x7);
 			if (hdr->length < 0x19)
 				break;
-			dmi_uuid_check(fw, table, addr, "UUID", hdr, 0x8, version);
+			dmi_uuid_check(fw, table, addr, "UUID", hdr, 0x8);
 			dmi_min_max_uint8_check(fw, table, addr, "Wakeup Type", hdr, 0x18, 0x0, 0x08);
 			if (hdr->length < 0x1b)
 				break;
@@ -1178,8 +1176,7 @@  static int dmi_version_check(fwts_framework *fw, uint16_t version)
 
 static void dmi_scan_tables(fwts_framework *fw,
 	fwts_smbios_entry *entry,
-	uint8_t  *table,
-	uint16_t version)
+	uint8_t  *table)
 {
 	uint8_t *entry_data = table;
 	uint16_t table_length;
@@ -1226,7 +1223,7 @@  static void dmi_scan_tables(fwts_framework *fw,
 		next_entry += 2;
 
 		if ((next_entry - table) <= table_length)
-			dmi_decode_entry(fw, addr, &hdr, version);
+			dmi_decode_entry(fw, addr, &hdr);
 
 		i++;
 		entry_data = next_entry;
@@ -1280,7 +1277,7 @@  static int dmi_decode_test1(fwts_framework *fw)
 		return FWTS_ERROR;
 	}
 
-	dmi_scan_tables(fw, &entry, table, version);
+	dmi_scan_tables(fw, &entry, table);
 
 	(void)fwts_munmap(table, (size_t)entry.struct_table_length);