diff mbox

ASoC: Intel: remove status, it is shadowing status of a higher scope

Message ID 20160909090929.27845-1-colin.king@canonical.com (mailing list archive)
State Accepted
Commit dc995069c675af71a2ecf2ade0995df084da3e2e
Headers show

Commit Message

Colin King Sept. 9, 2016, 9:09 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The second declaration of status is shadowing the status of a higher
scope.  This uninitialized status results in garbage being returned
by the !x86_match_cpu(cpu_ids) || !iosf_mbi_available() return exit
path.  Fix this by removing the extraneous second declaration of
status.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/soc/intel/atom/sst/sst_acpi.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Pierre-Louis Bossart Sept. 9, 2016, 5:04 p.m. UTC | #1
On 9/9/16 2:09 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The second declaration of status is shadowing the status of a higher
> scope.  This uninitialized status results in garbage being returned
> by the !x86_match_cpu(cpu_ids) || !iosf_mbi_available() return exit
> path.  Fix this by removing the extraneous second declaration of
> status.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Gah... thanks for correcting this, not sure how I missed it, was there a 
compiler warning?
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> ---
>  sound/soc/intel/atom/sst/sst_acpi.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
> index 773acfb..4c14215 100644
> --- a/sound/soc/intel/atom/sst/sst_acpi.c
> +++ b/sound/soc/intel/atom/sst/sst_acpi.c
> @@ -249,7 +249,6 @@ static int is_byt_cr(struct device *dev, bool *bytcr)
>  			{ X86_VENDOR_INTEL, 6, 55 }, /* Valleyview, Bay Trail */
>  			{}
>  		};
> -		int status;
>  		u32 bios_status;
>
>  		if (!x86_match_cpu(cpu_ids) || !iosf_mbi_available()) {
>
Colin King Sept. 9, 2016, 5:09 p.m. UTC | #2
On 09/09/16 18:04, Pierre-Louis Bossart wrote:
> On 9/9/16 2:09 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The second declaration of status is shadowing the status of a higher
>> scope.  This uninitialized status results in garbage being returned
>> by the !x86_match_cpu(cpu_ids) || !iosf_mbi_available() return exit
>> path.  Fix this by removing the extraneous second declaration of
>> status.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Gah... thanks for correcting this, not sure how I missed it, was there a
> compiler warning?

static analysis tools, this time CoverityScan

> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
>> ---
>>  sound/soc/intel/atom/sst/sst_acpi.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/sound/soc/intel/atom/sst/sst_acpi.c
>> b/sound/soc/intel/atom/sst/sst_acpi.c
>> index 773acfb..4c14215 100644
>> --- a/sound/soc/intel/atom/sst/sst_acpi.c
>> +++ b/sound/soc/intel/atom/sst/sst_acpi.c
>> @@ -249,7 +249,6 @@ static int is_byt_cr(struct device *dev, bool *bytcr)
>>              { X86_VENDOR_INTEL, 6, 55 }, /* Valleyview, Bay Trail */
>>              {}
>>          };
>> -        int status;
>>          u32 bios_status;
>>
>>          if (!x86_match_cpu(cpu_ids) || !iosf_mbi_available()) {
>>
>
diff mbox

Patch

diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index 773acfb..4c14215 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -249,7 +249,6 @@  static int is_byt_cr(struct device *dev, bool *bytcr)
 			{ X86_VENDOR_INTEL, 6, 55 }, /* Valleyview, Bay Trail */
 			{}
 		};
-		int status;
 		u32 bios_status;
 
 		if (!x86_match_cpu(cpu_ids) || !iosf_mbi_available()) {