Skip to contentSkip to conversation

drivers/gpu/drm/sti/sti_mixer.c:145:47: sparse: sparse: incorrect type in argument 1 (different address spaces)

PATCH In review kernel test robot 4 participants 4 messages Nov 20, 2024 – Nov 26, 2024

Subsystems (3)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

Hi Ville,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   158f238aa69d91ad74e535c73f552bd4b025109c
commit: 74bde7581df3e18061119e1b27b63d0a9ea57b7a drm/sti: Allow build with COMPILE_TEST=y
date:   6 months ago
config: sh-randconfig-r132-20241119 (https://download.01.org/0day-ci/archive/20241119/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241119/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/sti/sti_mixer.c:145:47: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *ptr @@     got void * @@

drivers/gpu/drm/sti/sti_mixer.c:145:47: sparse: expected void const volatile [noderef] __iomem *ptr
drivers/gpu/drm/sti/sti_mixer.c:145:47: sparse: got void *
drivers/gpu/drm/sti/sti_mixer.c:168:38: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *addr @@ got void [noderef] __iomem * @@
drivers/gpu/drm/sti/sti_mixer.c:168:38: sparse: expected void *addr
drivers/gpu/drm/sti/sti_mixer.c:168:38: sparse: got void [noderef] __iomem *

vim +145 drivers/gpu/drm/sti/sti_mixer.c

a5f81078a56c6a Vincent Abriou 2016-02-04  139  
a5f81078a56c6a Vincent Abriou 2016-02-04  140  static void mixer_dbg_mxn(struct seq_file *s, void *addr)
a5f81078a56c6a Vincent Abriou 2016-02-04  141  {
a5f81078a56c6a Vincent Abriou 2016-02-04  142  	int i;
a5f81078a56c6a Vincent Abriou 2016-02-04  143  
a5f81078a56c6a Vincent Abriou 2016-02-04  144  	for (i = 1; i < 8; i++)

a5f81078a56c6a Vincent Abriou 2016-02-04 @145 seq_printf(s, "-0x%08X", (int)readl(addr + i * 4));
a5f81078a56c6a Vincent Abriou 2016-02-04 146 }
a5f81078a56c6a Vincent Abriou 2016-02-04 147

:::::: The code at line 145 was first introduced by commit
:::::: a5f81078a56c6ab57b7db2402ac64c34338004c5 drm/sti: add debugfs entries for MIXER crtc

:::::: TO: Vincent Abriou <[email protected]>
:::::: CC: Vincent Abriou <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw

PATCH 1/1 drm/sti: Add __iomem for mixer_dbg_mxn's parameter

Sparse complains about incorrect type in argument 1. expected void const volatile __iomem *ptr but got void *. so modify mixer_dbg_mxn's addr parameter.

Fixes a5f81078a56c ("drm/sti: add debugfs entries for MIXER crtc")
---
 drivers/gpu/drm/sti/sti_mixer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sti/sti_mixer.c +1 -1
index 7e5f14646625..06c1b81912f7 100644
@@ -137,7 +137,7 @@ static void mixer_dbg_crb(struct seq_file *s, int val)
 	}
 }
 
-static void mixer_dbg_mxn(struct seq_file *s, void *addr)
+static void mixer_dbg_mxn(struct seq_file *s, void __iomem *addr)
 {
 	int i;
 
Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/1
#2 lore raw

Re: [PATCH] drm/sti: Add __iomem for mixer_dbg_mxn's parameter

Quoted 10 lines

Sparse complains about incorrect type in argument 1. expected void const volatile __iomem *ptr but got void *. so modify mixer_dbg_mxn's addr parameter.

Fixes a5f81078a56c ("drm/sti: add debugfs entries for MIXER crtc")

Hi,

Thanks for your fix.

Regards,
Raphaël

Quoted 17 lines
---
  drivers/gpu/drm/sti/sti_mixer.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sti/sti_mixer.c +1 -1
index 7e5f14646625..06c1b81912f7 100644
@@ -137,7 +137,7 @@ static void mixer_dbg_crb(struct seq_file *s, int val)
  	}
  }
 
-static void mixer_dbg_mxn(struct seq_file *s, void *addr)
+static void mixer_dbg_mxn(struct seq_file *s, void __iomem *addr)
  {
  	int i;
 
#3 lore raw

Re: [PATCH] drm/sti: Add __iomem for mixer_dbg_mxn's parameter

In reply to Pei Xiao
Quoted 8 lines · Pei Xiao

Sparse complains about incorrect type in argument 1. expected void const volatile __iomem *ptr but got void *. so modify mixer_dbg_mxn's addr parameter.

Fixes a5f81078a56c ("drm/sti: add debugfs entries for MIXER crtc")

Hi,

Applied on drm-misc-fixes.

Thanks,

RaphaEl Gallais-Pou