2020-04-09 09:37:16

by Jason Yan

[permalink] [raw]
Subject: [PATCH v2] EDAC, xgene: remove set but not used 'address'

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;
^~~~~~~
And remove the unused macro RBERRADDR_RD after that.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Jason Yan <[email protected]>
---
drivers/edac/xgene_edac.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index e4a1032ba0b5..1d2c27a00a4a 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -1349,7 +1349,6 @@ static int xgene_edac_l3_remove(struct xgene_edac_dev_ctx *l3)
#define WORD_ALIGNED_ERR_MASK BIT(28)
#define PAGE_ACCESS_ERR_MASK BIT(27)
#define WRITE_ACCESS_MASK BIT(26)
-#define RBERRADDR_RD(src) ((src) & 0x03FFFFFF)

static const char * const soc_mem_err_v1[] = {
"10GbE0",
@@ -1483,13 +1482,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",
--
2.17.2


2020-04-14 15:39:23

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH v2] EDAC, xgene: remove set but not used 'address'

On Thu, Apr 09, 2020 at 05:32:59PM +0800, 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;
> ^~~~~~~
> And remove the unused macro RBERRADDR_RD after that.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Jason Yan <[email protected]>
> ---
> drivers/edac/xgene_edac.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
> index e4a1032ba0b5..1d2c27a00a4a 100644
> --- a/drivers/edac/xgene_edac.c
> +++ b/drivers/edac/xgene_edac.c
> @@ -1349,7 +1349,6 @@ static int xgene_edac_l3_remove(struct xgene_edac_dev_ctx *l3)
> #define WORD_ALIGNED_ERR_MASK BIT(28)
> #define PAGE_ACCESS_ERR_MASK BIT(27)
> #define WRITE_ACCESS_MASK BIT(26)
> -#define RBERRADDR_RD(src) ((src) & 0x03FFFFFF)
>
> static const char * const soc_mem_err_v1[] = {
> "10GbE0",
> @@ -1483,13 +1482,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",
> --

Applied, thanks.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette