diff mbox series

EDAC, xgene: remove set but not used 'address'

Message ID 20200409085237.46642-1-yanaijie@huawei.com (mailing list archive)
State New, archived
Headers show
Series EDAC, xgene: remove set but not used 'address' | expand

Commit Message

Jason Yan April 9, 2020, 8:52 a.m. UTC
Fix the following gcc warning:

drivers/edac/xgene_edac.c:1486:7: warning: variable ‘address’ set but
not used [-Wunused-but-set-variable]
   u32 address;
       ^~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/edac/xgene_edac.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Robert Richter April 9, 2020, 9:10 a.m. UTC | #1
On 09.04.20 16:52:37, Jason Yan wrote:
> Fix the following gcc warning:
> 
> drivers/edac/xgene_edac.c:1486:7: warning: variable ‘address’ set but
> not used [-Wunused-but-set-variable]
>    u32 address;
>        ^~~~~~~
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> ---
>  drivers/edac/xgene_edac.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
> index e4a1032ba0b5..e5e0fbdeca29 100644
> --- a/drivers/edac/xgene_edac.c
> +++ b/drivers/edac/xgene_edac.c
> @@ -1483,13 +1483,11 @@ static void xgene_edac_rb_report(struct edac_device_ctl_info *edac_dev)
>  		return;
>  	if (reg & STICKYERR_MASK) {
>  		bool write;
> -		u32 address;
>  
>  		dev_err(edac_dev->dev, "IOB bus access error(s)\n");
>  		if (regmap_read(ctx->edac->rb_map, RBEIR, &reg))
>  			return;
>  		write = reg & WRITE_ACCESS_MASK ? 1 : 0;
> -		address = RBERRADDR_RD(reg);

Please also remove that unused macro.

Thanks,

-Robert

>  		if (reg & AGENT_OFFLINE_ERR_MASK)
>  			dev_err(edac_dev->dev,
>  				"IOB bus %s access to offline agent error\n",
> -- 
> 2.17.2
>
Jason Yan April 9, 2020, 9:15 a.m. UTC | #2
在 2020/4/9 17:10, Robert Richter 写道:
> On 09.04.20 16:52:37, Jason Yan wrote:
>> Fix the following gcc warning:
>>
>> drivers/edac/xgene_edac.c:1486:7: warning: variable ‘address’ set but
>> not used [-Wunused-but-set-variable]
>>     u32 address;
>>         ^~~~~~~
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>> ---
>>   drivers/edac/xgene_edac.c | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
>> index e4a1032ba0b5..e5e0fbdeca29 100644
>> --- a/drivers/edac/xgene_edac.c
>> +++ b/drivers/edac/xgene_edac.c
>> @@ -1483,13 +1483,11 @@ static void xgene_edac_rb_report(struct edac_device_ctl_info *edac_dev)
>>   		return;
>>   	if (reg & STICKYERR_MASK) {
>>   		bool write;
>> -		u32 address;
>>   
>>   		dev_err(edac_dev->dev, "IOB bus access error(s)\n");
>>   		if (regmap_read(ctx->edac->rb_map, RBEIR, &reg))
>>   			return;
>>   		write = reg & WRITE_ACCESS_MASK ? 1 : 0;
>> -		address = RBERRADDR_RD(reg);
> 
> Please also remove that unused macro.
> 

OK, thanks.

Jason

> Thanks,
> 
> -Robert
> 
>>   		if (reg & AGENT_OFFLINE_ERR_MASK)
>>   			dev_err(edac_dev->dev,
>>   				"IOB bus %s access to offline agent error\n",
>> -- 
>> 2.17.2
>>
>
diff mbox series

Patch

diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index e4a1032ba0b5..e5e0fbdeca29 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -1483,13 +1483,11 @@  static void xgene_edac_rb_report(struct edac_device_ctl_info *edac_dev)
 		return;
 	if (reg & STICKYERR_MASK) {
 		bool write;
-		u32 address;
 
 		dev_err(edac_dev->dev, "IOB bus access error(s)\n");
 		if (regmap_read(ctx->edac->rb_map, RBEIR, &reg))
 			return;
 		write = reg & WRITE_ACCESS_MASK ? 1 : 0;
-		address = RBERRADDR_RD(reg);
 		if (reg & AGENT_OFFLINE_ERR_MASK)
 			dev_err(edac_dev->dev,
 				"IOB bus %s access to offline agent error\n",