All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] reset: intel: fix a compile warning about REG_OFFSET redefined
@ 2020-06-04 15:30 Dejin Zheng
  2020-06-26 10:38 ` Philipp Zabel
  0 siblings, 1 reply; 3+ messages in thread
From: Dejin Zheng @ 2020-06-04 15:30 UTC (permalink / raw)
  To: p.zabel, broonie; +Cc: linux-kernel, Dejin Zheng, kernel test robot

kernel test robot reports a compile warning about REG_OFFSET redefined
in the reset-intel-gw.c after merging commit e44ab4e14d6f4 ("regmap:
Simplify implementation of the regmap_read_poll_timeout() macro"). the
warning is like that:

drivers/reset/reset-intel-gw.c:18:0: warning: "REG_OFFSET" redefined
 #define REG_OFFSET GENMASK(31, 16)

In file included from ./arch/arm/mach-ixp4xx/include/mach/hardware.h:30:0,
                 from ./arch/arm/mach-ixp4xx/include/mach/io.h:15,
                 from ./arch/arm/include/asm/io.h:198,
                 from ./include/linux/io.h:13,
                 from ./include/linux/iopoll.h:14,
                 from ./include/linux/regmap.h:20,
                 from drivers/reset/reset-intel-gw.c:12:
./arch/arm/mach-ixp4xx/include/mach/platform.h:25:0: note: this is the location of the previous definition
 #define REG_OFFSET 3

Reported-by: kernel test robot <lkp@intel.com>
Fixes: e44ab4e14d6f4 ("regmap: Simplify implementation of the regmap_read_poll_timeout() macro")
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
 drivers/reset/reset-intel-gw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/reset/reset-intel-gw.c b/drivers/reset/reset-intel-gw.c
index 854238444616..5cfb4892b399 100644
--- a/drivers/reset/reset-intel-gw.c
+++ b/drivers/reset/reset-intel-gw.c
@@ -15,7 +15,7 @@
 #define RCU_RST_STAT	0x0024
 #define RCU_RST_REQ	0x0048
 
-#define REG_OFFSET	GENMASK(31, 16)
+#define REG_OFFSET_MASK	GENMASK(31, 16)
 #define BIT_OFFSET	GENMASK(15, 8)
 #define STAT_BIT_OFFSET	GENMASK(7, 0)
 
@@ -51,7 +51,7 @@ static u32 id_to_reg_and_bit_offsets(struct intel_reset_data *data,
 				     unsigned long id, u32 *rst_req,
 				     u32 *req_bit, u32 *stat_bit)
 {
-	*rst_req = FIELD_GET(REG_OFFSET, id);
+	*rst_req = FIELD_GET(REG_OFFSET_MASK, id);
 	*req_bit = FIELD_GET(BIT_OFFSET, id);
 
 	if (data->soc_data->legacy)
@@ -141,7 +141,7 @@ static int intel_reset_xlate(struct reset_controller_dev *rcdev,
 	if (spec->args[1] > 31)
 		return -EINVAL;
 
-	id = FIELD_PREP(REG_OFFSET, spec->args[0]);
+	id = FIELD_PREP(REG_OFFSET_MASK, spec->args[0]);
 	id |= FIELD_PREP(BIT_OFFSET, spec->args[1]);
 
 	if (data->soc_data->legacy) {
@@ -210,7 +210,7 @@ static int intel_reset_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	data->reboot_id = FIELD_PREP(REG_OFFSET, rb_id[0]);
+	data->reboot_id = FIELD_PREP(REG_OFFSET_MASK, rb_id[0]);
 	data->reboot_id |= FIELD_PREP(BIT_OFFSET, rb_id[1]);
 
 	if (data->soc_data->legacy)
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] reset: intel: fix a compile warning about REG_OFFSET redefined
  2020-06-04 15:30 [PATCH v1] reset: intel: fix a compile warning about REG_OFFSET redefined Dejin Zheng
@ 2020-06-26 10:38 ` Philipp Zabel
  2020-06-26 12:33   ` Dejin Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Zabel @ 2020-06-26 10:38 UTC (permalink / raw)
  To: Dejin Zheng, broonie; +Cc: linux-kernel, kernel test robot

Hi Dejin,

On Thu, 2020-06-04 at 23:30 +0800, Dejin Zheng wrote:
> kernel test robot reports a compile warning about REG_OFFSET redefined
> in the reset-intel-gw.c after merging commit e44ab4e14d6f4 ("regmap:
> Simplify implementation of the regmap_read_poll_timeout() macro"). the
> warning is like that:
> 
> drivers/reset/reset-intel-gw.c:18:0: warning: "REG_OFFSET" redefined
>  #define REG_OFFSET GENMASK(31, 16)
> 
> In file included from ./arch/arm/mach-ixp4xx/include/mach/hardware.h:30:0,
>                  from ./arch/arm/mach-ixp4xx/include/mach/io.h:15,
>                  from ./arch/arm/include/asm/io.h:198,
>                  from ./include/linux/io.h:13,
>                  from ./include/linux/iopoll.h:14,
>                  from ./include/linux/regmap.h:20,
>                  from drivers/reset/reset-intel-gw.c:12:
> ./arch/arm/mach-ixp4xx/include/mach/platform.h:25:0: note: this is the location of the previous definition
>  #define REG_OFFSET 3
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: e44ab4e14d6f4 ("regmap: Simplify implementation of the regmap_read_poll_timeout() macro")

Hm, shouldn't this rather be:

Fixes: c9aef213e38c ("reset: intel: Add system reset controller driver")

even though e44ab4e14d6f4 triggered the issue by including iopoll.h?

> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> ---
>  drivers/reset/reset-intel-gw.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/reset/reset-intel-gw.c b/drivers/reset/reset-intel-gw.c
> index 854238444616..5cfb4892b399 100644
> --- a/drivers/reset/reset-intel-gw.c
> +++ b/drivers/reset/reset-intel-gw.c
> @@ -15,7 +15,7 @@
>  #define RCU_RST_STAT	0x0024
>  #define RCU_RST_REQ	0x0048
>  
> -#define REG_OFFSET	GENMASK(31, 16)
> +#define REG_OFFSET_MASK	GENMASK(31, 16)
>  #define BIT_OFFSET	GENMASK(15, 8)
>  #define STAT_BIT_OFFSET	GENMASK(7, 0)

Could you add the _MASK suffix to BIT_OFFSET and STAT_BIT_OFFSET as
well, for consistency?

regards
Philipp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] reset: intel: fix a compile warning about REG_OFFSET redefined
  2020-06-26 10:38 ` Philipp Zabel
@ 2020-06-26 12:33   ` Dejin Zheng
  0 siblings, 0 replies; 3+ messages in thread
From: Dejin Zheng @ 2020-06-26 12:33 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: broonie, linux-kernel, kernel test robot

On Fri, Jun 26, 2020 at 12:38:13PM +0200, Philipp Zabel wrote:
Hi Philipp:

Thanks very much for your review!

> Hi Dejin,
> 
> On Thu, 2020-06-04 at 23:30 +0800, Dejin Zheng wrote:
> > kernel test robot reports a compile warning about REG_OFFSET redefined
> > in the reset-intel-gw.c after merging commit e44ab4e14d6f4 ("regmap:
> > Simplify implementation of the regmap_read_poll_timeout() macro"). the
> > warning is like that:
> > 
> > drivers/reset/reset-intel-gw.c:18:0: warning: "REG_OFFSET" redefined
> >  #define REG_OFFSET GENMASK(31, 16)
> > 
> > In file included from ./arch/arm/mach-ixp4xx/include/mach/hardware.h:30:0,
> >                  from ./arch/arm/mach-ixp4xx/include/mach/io.h:15,
> >                  from ./arch/arm/include/asm/io.h:198,
> >                  from ./include/linux/io.h:13,
> >                  from ./include/linux/iopoll.h:14,
> >                  from ./include/linux/regmap.h:20,
> >                  from drivers/reset/reset-intel-gw.c:12:
> > ./arch/arm/mach-ixp4xx/include/mach/platform.h:25:0: note: this is the location of the previous definition
> >  #define REG_OFFSET 3
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Fixes: e44ab4e14d6f4 ("regmap: Simplify implementation of the regmap_read_poll_timeout() macro")
> 
> Hm, shouldn't this rather be:
> 
> Fixes: c9aef213e38c ("reset: intel: Add system reset controller driver")
> 
> even though e44ab4e14d6f4 triggered the issue by including iopoll.h?
>
Ok.

> > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> > ---
> >  drivers/reset/reset-intel-gw.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/reset/reset-intel-gw.c b/drivers/reset/reset-intel-gw.c
> > index 854238444616..5cfb4892b399 100644
> > --- a/drivers/reset/reset-intel-gw.c
> > +++ b/drivers/reset/reset-intel-gw.c
> > @@ -15,7 +15,7 @@
> >  #define RCU_RST_STAT	0x0024
> >  #define RCU_RST_REQ	0x0048
> >  
> > -#define REG_OFFSET	GENMASK(31, 16)
> > +#define REG_OFFSET_MASK	GENMASK(31, 16)
> >  #define BIT_OFFSET	GENMASK(15, 8)
> >  #define STAT_BIT_OFFSET	GENMASK(7, 0)
> 
> Could you add the _MASK suffix to BIT_OFFSET and STAT_BIT_OFFSET as
> well, for consistency?
>
I will add it in next patch version. Thanks!

BR,
Dejin

> regards
> Philipp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-26 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 15:30 [PATCH v1] reset: intel: fix a compile warning about REG_OFFSET redefined Dejin Zheng
2020-06-26 10:38 ` Philipp Zabel
2020-06-26 12:33   ` Dejin Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.