diff mbox series

cxl/regs: Fix sparse warning

Message ID 167008768190.2516013.11918622906007677341.stgit@dwillia2-xfh.jf.intel.com
State Accepted
Commit 397cd265815eae562685d9832dc8b61c927c1cfb
Headers show
Series cxl/regs: Fix sparse warning | expand

Commit Message

Dan Williams Dec. 3, 2022, 5:14 p.m. UTC
The 0day robot belatedly points out that @addr is not properly tagged as
an iomap pointer:

"drivers/cxl/core/regs.c:332:14: sparse: sparse: incorrect type in
assignment (different address spaces) @@     expected void *addr @@
got void [noderef] __iomem * @@"

Fixes: 1168271ca054 ("cxl/acpi: Extract component registers of restricted hosts from RCRB")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/cxl/core/regs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alison Schofield Dec. 3, 2022, 7:59 p.m. UTC | #1
On Sat, Dec 03, 2022 at 09:14:41AM -0800, Dan Williams wrote:
> The 0day robot belatedly points out that @addr is not properly tagged as
> an iomap pointer:
> 
> "drivers/cxl/core/regs.c:332:14: sparse: sparse: incorrect type in
> assignment (different address spaces) @@     expected void *addr @@
> got void [noderef] __iomem * @@"
> 
> Fixes: 1168271ca054 ("cxl/acpi: Extract component registers of restricted hosts from RCRB")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Alison Schofield <alison.schofield@intel.com>

> ---
>  drivers/cxl/core/regs.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c
> index 1173912b9cf7..5a812583aee1 100644
> --- a/drivers/cxl/core/regs.c
> +++ b/drivers/cxl/core/regs.c
> @@ -313,8 +313,8 @@ resource_size_t cxl_rcrb_to_component(struct device *dev,
>  				      enum cxl_rcrb which)
>  {
>  	resource_size_t component_reg_phys;
> +	void __iomem *addr;
>  	u32 bar0, bar1;
> -	void *addr;
>  	u16 cmd;
>  	u32 id;
>  
>
Robert Richter Dec. 5, 2022, 12:02 p.m. UTC | #2
On 03.12.22 09:14:41, Dan Williams wrote:
> The 0day robot belatedly points out that @addr is not properly tagged as
> an iomap pointer:
> 
> "drivers/cxl/core/regs.c:332:14: sparse: sparse: incorrect type in
> assignment (different address spaces) @@     expected void *addr @@
> got void [noderef] __iomem * @@"
> 
> Fixes: 1168271ca054 ("cxl/acpi: Extract component registers of restricted hosts from RCRB")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Robert Richter <rrichter@amd.com>

> ---
>  drivers/cxl/core/regs.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c
index 1173912b9cf7..5a812583aee1 100644
--- a/drivers/cxl/core/regs.c
+++ b/drivers/cxl/core/regs.c
@@ -313,8 +313,8 @@  resource_size_t cxl_rcrb_to_component(struct device *dev,
 				      enum cxl_rcrb which)
 {
 	resource_size_t component_reg_phys;
+	void __iomem *addr;
 	u32 bar0, bar1;
-	void *addr;
 	u16 cmd;
 	u32 id;