Patchwork [17/26] bios: hdaaudio: remove redundant fw parameter from hda_audio_check_pins

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

Comments

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

Function hda_audio_check_pins does not require the fwts_framework fw
parameter, so remove it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/bios/hdaaudio/hdaaudio.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
Alex Hung - Oct. 15, 2012, 5:44 a.m.
On 10/15/2012 04:32 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Function hda_audio_check_pins does not require the fwts_framework fw
> parameter, so remove it.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/bios/hdaaudio/hdaaudio.c |   12 ++++--------
>   1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c
> index 455a35a..764e18e 100644
> --- a/src/bios/hdaaudio/hdaaudio.c
> +++ b/src/bios/hdaaudio/hdaaudio.c
> @@ -26,8 +26,7 @@ typedef struct {
>   	uint32_t	setting;
>   } hda_audio_pin_setting;
>
> -static int hda_audio_read_pins(fwts_framework *fw, const char *path,
> -	const char *file, fwts_list *settings)
> +static int hda_audio_read_pins(const char *path, const char *file, fwts_list *settings)
>   {
>   	FILE 		*fp;
>   	uint16_t	pin;
> @@ -108,12 +107,9 @@ static int hda_audio_check_pins(fwts_framework *fw, const char *path)
>   	hda_audio_dev_info(fw, "Subsystem ID", path, "subsystem_id");
>   	hda_audio_dev_info(fw, "Revision ID", path, "revision_id");
>
> -	(void)hda_audio_read_pins(fw, path, "init_pin_configs",
> -		&init_pin_configs);
> -	(void)hda_audio_read_pins(fw, path, "driver_pin_configs",
> -		&driver_pin_configs);
> -	(void)hda_audio_read_pins(fw, path, "user_pin_configs",
> -		&user_pin_configs);
> +	(void)hda_audio_read_pins(path, "init_pin_configs", &init_pin_configs);
> +	(void)hda_audio_read_pins(path, "driver_pin_configs", &driver_pin_configs);
> +	(void)hda_audio_read_pins(path, "user_pin_configs", &user_pin_configs);
>
>   	if (fwts_list_len(&init_pin_configs) > 0)
>   		hda_audio_dump_pins(fw, "BIOS pin configurations",
>

Acked-by: Alex Hung <alex.hung@canonical.com>

I also found that the below code seems incorrect. Is it a typo in the 
&driver_pin_configs when it should be &user_pin_configs?

if (fwts_list_len(&user_pin_configs) > 0) {
     hda_audio_dump_pins(fw, "User defined pin configurations",
            &driver_pin_configs);
     warn++;
}
Colin King - Oct. 15, 2012, 8:19 a.m.
On 15/10/12 06:44, Alex Hung wrote:
> On 10/15/2012 04:32 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Function hda_audio_check_pins does not require the fwts_framework fw
>> parameter, so remove it.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   src/bios/hdaaudio/hdaaudio.c |   12 ++++--------
>>   1 file changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c
>> index 455a35a..764e18e 100644
>> --- a/src/bios/hdaaudio/hdaaudio.c
>> +++ b/src/bios/hdaaudio/hdaaudio.c
>> @@ -26,8 +26,7 @@ typedef struct {
>>       uint32_t    setting;
>>   } hda_audio_pin_setting;
>>
>> -static int hda_audio_read_pins(fwts_framework *fw, const char *path,
>> -    const char *file, fwts_list *settings)
>> +static int hda_audio_read_pins(const char *path, const char *file,
>> fwts_list *settings)
>>   {
>>       FILE         *fp;
>>       uint16_t    pin;
>> @@ -108,12 +107,9 @@ static int hda_audio_check_pins(fwts_framework
>> *fw, const char *path)
>>       hda_audio_dev_info(fw, "Subsystem ID", path, "subsystem_id");
>>       hda_audio_dev_info(fw, "Revision ID", path, "revision_id");
>>
>> -    (void)hda_audio_read_pins(fw, path, "init_pin_configs",
>> -        &init_pin_configs);
>> -    (void)hda_audio_read_pins(fw, path, "driver_pin_configs",
>> -        &driver_pin_configs);
>> -    (void)hda_audio_read_pins(fw, path, "user_pin_configs",
>> -        &user_pin_configs);
>> +    (void)hda_audio_read_pins(path, "init_pin_configs",
>> &init_pin_configs);
>> +    (void)hda_audio_read_pins(path, "driver_pin_configs",
>> &driver_pin_configs);
>> +    (void)hda_audio_read_pins(path, "user_pin_configs",
>> &user_pin_configs);
>>
>>       if (fwts_list_len(&init_pin_configs) > 0)
>>           hda_audio_dump_pins(fw, "BIOS pin configurations",
>>
>
> Acked-by: Alex Hung <alex.hung@canonical.com>
>
> I also found that the below code seems incorrect. Is it a typo in the
> &driver_pin_configs when it should be &user_pin_configs?
>
> if (fwts_list_len(&user_pin_configs) > 0) {
>      hda_audio_dump_pins(fw, "User defined pin configurations",
>             &driver_pin_configs);
>      warn++;
> }
>
Yes, cut'n'paste bug. I will send a fix for this later. Well spotted.

Colin
>
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>
>
> Function hda_audio_check_pins does not require the fwts_framework fw
> parameter, so remove it.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/bios/hdaaudio/hdaaudio.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c
> index 455a35a..764e18e 100644
> --- a/src/bios/hdaaudio/hdaaudio.c
> +++ b/src/bios/hdaaudio/hdaaudio.c
> @@ -26,8 +26,7 @@ typedef struct {
>         uint32_t        setting;
>  } hda_audio_pin_setting;
>
> -static int hda_audio_read_pins(fwts_framework *fw, const char *path,
> -       const char *file, fwts_list *settings)
> +static int hda_audio_read_pins(const char *path, const char *file, fwts_list *settings)
>  {
>         FILE            *fp;
>         uint16_t        pin;
> @@ -108,12 +107,9 @@ static int hda_audio_check_pins(fwts_framework *fw, const char *path)
>         hda_audio_dev_info(fw, "Subsystem ID", path, "subsystem_id");
>         hda_audio_dev_info(fw, "Revision ID", path, "revision_id");
>
> -       (void)hda_audio_read_pins(fw, path, "init_pin_configs",
> -               &init_pin_configs);
> -       (void)hda_audio_read_pins(fw, path, "driver_pin_configs",
> -               &driver_pin_configs);
> -       (void)hda_audio_read_pins(fw, path, "user_pin_configs",
> -               &user_pin_configs);
> +       (void)hda_audio_read_pins(path, "init_pin_configs", &init_pin_configs);
> +       (void)hda_audio_read_pins(path, "driver_pin_configs", &driver_pin_configs);
> +       (void)hda_audio_read_pins(path, "user_pin_configs", &user_pin_configs);
>
>         if (fwts_list_len(&init_pin_configs) > 0)
>                 hda_audio_dump_pins(fw, "BIOS pin configurations",
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c
index 455a35a..764e18e 100644
--- a/src/bios/hdaaudio/hdaaudio.c
+++ b/src/bios/hdaaudio/hdaaudio.c
@@ -26,8 +26,7 @@  typedef struct {
 	uint32_t	setting;
 } hda_audio_pin_setting;
 
-static int hda_audio_read_pins(fwts_framework *fw, const char *path,
-	const char *file, fwts_list *settings)
+static int hda_audio_read_pins(const char *path, const char *file, fwts_list *settings)
 {
 	FILE 		*fp;
 	uint16_t	pin;
@@ -108,12 +107,9 @@  static int hda_audio_check_pins(fwts_framework *fw, const char *path)
 	hda_audio_dev_info(fw, "Subsystem ID", path, "subsystem_id");
 	hda_audio_dev_info(fw, "Revision ID", path, "revision_id");
 
-	(void)hda_audio_read_pins(fw, path, "init_pin_configs",
-		&init_pin_configs);
-	(void)hda_audio_read_pins(fw, path, "driver_pin_configs",
-		&driver_pin_configs);
-	(void)hda_audio_read_pins(fw, path, "user_pin_configs",
-		&user_pin_configs);
+	(void)hda_audio_read_pins(path, "init_pin_configs", &init_pin_configs);
+	(void)hda_audio_read_pins(path, "driver_pin_configs", &driver_pin_configs);
+	(void)hda_audio_read_pins(path, "user_pin_configs", &user_pin_configs);
 
 	if (fwts_list_len(&init_pin_configs) > 0)
 		hda_audio_dump_pins(fw, "BIOS pin configurations",