From: kernel test robot <lkp@intel.com>
To: Wolfram Sang <wsa-dev@sang-engineering.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [wsa:renesas/hwspinlock/refactor-alloc-buildtest 7/15] drivers/hwspinlock/sprd_hwspinlock.c:75:30: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Thu, 05 Mar 2026 08:22:48 +0800 [thread overview]
Message-ID: <202603050852.A6WYAQG7-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/hwspinlock/refactor-alloc-buildtest
head: f2fc589840b1a727d4318cd5e9fc99d23fb3a35c
commit: a2e0dd64061bc41ef377813e9a1626e8b1fa54c7 [7/15] hwspinlock: sprd: use new callback to initialize hwspinlock priv
config: microblaze-randconfig-r121-20260304 (https://download.01.org/0day-ci/archive/20260305/202603050852.A6WYAQG7-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 9.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260305/202603050852.A6WYAQG7-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603050852.A6WYAQG7-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/hwspinlock/sprd_hwspinlock.c:44:50: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/hwspinlock/sprd_hwspinlock.c:44:50: sparse: expected void [noderef] __iomem *addr
drivers/hwspinlock/sprd_hwspinlock.c:44:50: sparse: got void *
drivers/hwspinlock/sprd_hwspinlock.c:62:55: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *lock_addr @@ got void * @@
drivers/hwspinlock/sprd_hwspinlock.c:62:55: sparse: expected void [noderef] __iomem *lock_addr
drivers/hwspinlock/sprd_hwspinlock.c:62:55: sparse: got void *
>> drivers/hwspinlock/sprd_hwspinlock.c:75:30: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *base @@ got void *init_data @@
drivers/hwspinlock/sprd_hwspinlock.c:75:30: sparse: expected void [noderef] __iomem *base
drivers/hwspinlock/sprd_hwspinlock.c:75:30: sparse: got void *init_data
>> drivers/hwspinlock/sprd_hwspinlock.c:77:21: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void * @@ got void [noderef] __iomem * @@
drivers/hwspinlock/sprd_hwspinlock.c:77:21: sparse: expected void *
drivers/hwspinlock/sprd_hwspinlock.c:77:21: sparse: got void [noderef] __iomem *
>> drivers/hwspinlock/sprd_hwspinlock.c:137:71: sparse: sparse: incorrect type in argument 6 (different address spaces) @@ expected void *init_data @@ got void [noderef] __iomem *base @@
drivers/hwspinlock/sprd_hwspinlock.c:137:71: sparse: expected void *init_data
drivers/hwspinlock/sprd_hwspinlock.c:137:71: sparse: got void [noderef] __iomem *base
vim +75 drivers/hwspinlock/sprd_hwspinlock.c
72
73 static void *sprd_hwspinlock_init_priv(int local_id, void *init_data)
74 {
> 75 void __iomem *base = init_data;
76
> 77 return base + HWSPINLOCK_TOKEN(local_id);
78 }
79
80 static const struct hwspinlock_ops sprd_hwspinlock_ops = {
81 .trylock = sprd_hwspinlock_trylock,
82 .unlock = sprd_hwspinlock_unlock,
83 .relax = sprd_hwspinlock_relax,
84 .init_priv = sprd_hwspinlock_init_priv,
85 };
86
87 static void sprd_hwspinlock_disable(void *data)
88 {
89 struct sprd_hwspinlock_dev *sprd_hwlock = data;
90
91 clk_disable_unprepare(sprd_hwlock->clk);
92 }
93
94 static int sprd_hwspinlock_probe(struct platform_device *pdev)
95 {
96 struct sprd_hwspinlock_dev *sprd_hwlock;
97 int ret;
98
99 if (!pdev->dev.of_node)
100 return -ENODEV;
101
102 sprd_hwlock = devm_kzalloc(&pdev->dev,
103 struct_size(sprd_hwlock, bank.lock, SPRD_HWLOCKS_NUM),
104 GFP_KERNEL);
105 if (!sprd_hwlock)
106 return -ENOMEM;
107
108 sprd_hwlock->base = devm_platform_ioremap_resource(pdev, 0);
109 if (IS_ERR(sprd_hwlock->base))
110 return PTR_ERR(sprd_hwlock->base);
111
112 sprd_hwlock->clk = devm_clk_get(&pdev->dev, "enable");
113 if (IS_ERR(sprd_hwlock->clk)) {
114 dev_err(&pdev->dev, "get hwspinlock clock failed!\n");
115 return PTR_ERR(sprd_hwlock->clk);
116 }
117
118 ret = clk_prepare_enable(sprd_hwlock->clk);
119 if (ret)
120 return ret;
121
122 ret = devm_add_action_or_reset(&pdev->dev, sprd_hwspinlock_disable,
123 sprd_hwlock);
124 if (ret) {
125 dev_err(&pdev->dev,
126 "Failed to add hwspinlock disable action\n");
127 return ret;
128 }
129
130 /* set the hwspinlock to record user id to identify subsystems */
131 writel(HWSPINLOCK_USER_BITS, sprd_hwlock->base + HWSPINLOCK_RECCTRL);
132
133 platform_set_drvdata(pdev, sprd_hwlock);
134
135 return devm_hwspin_lock_register(&pdev->dev, &sprd_hwlock->bank,
136 &sprd_hwspinlock_ops, 0,
> 137 SPRD_HWLOCKS_NUM, sprd_hwlock->base);
138 }
139
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-03-05 0:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202603050852.A6WYAQG7-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=wsa-dev@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.