From: kernel test robot <lkp@intel.com>
To: Benjamin Gray <bgray@linux.ibm.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>,
Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: arch/powerpc/platforms/powermac/time.c:210:24: sparse: sparse: cast removes address space '__iomem' of expression
Date: Mon, 7 Aug 2023 10:58:55 +0800 [thread overview]
Message-ID: <202308071025.KCEf7Mhd-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 52a93d39b17dc7eb98b6aa3edb93943248e03b2f
commit: 86582e6189dd8f9f52c25d46c70fe5d111da6345 powerpc/powermac: Use early_* IO variants in via_calibrate_decr()
date: 5 days ago
config: powerpc-randconfig-r071-20230807 (https://download.01.org/0day-ci/archive/20230807/202308071025.KCEf7Mhd-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230807/202308071025.KCEf7Mhd-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/202308071025.KCEf7Mhd-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> arch/powerpc/platforms/powermac/time.c:210:24: sparse: sparse: cast removes address space '__iomem' of expression
>> arch/powerpc/platforms/powermac/time.c:210:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
arch/powerpc/platforms/powermac/time.c:210:24: sparse: expected void [noderef] __iomem *addr
arch/powerpc/platforms/powermac/time.c:210:24: sparse: got void *
arch/powerpc/platforms/powermac/time.c:192:30: sparse: sparse: dereference of noderef expression
arch/powerpc/platforms/powermac/time.c:192:30: sparse: sparse: dereference of noderef expression
arch/powerpc/platforms/powermac/time.c:196:27: sparse: sparse: cast truncates bits from constant value (b798 becomes 98)
vim +/__iomem +210 arch/powerpc/platforms/powermac/time.c
161
162 #ifdef CONFIG_PPC32
163 /*
164 * Calibrate the decrementer register using VIA timer 1.
165 * This is used both on powermacs and CHRP machines.
166 */
167 static int __init via_calibrate_decr(void)
168 {
169 struct device_node *vias;
170 volatile unsigned char __iomem *via;
171 int count = VIA_TIMER_FREQ_6 / 100;
172 unsigned int dstart, dend;
173 struct resource rsrc;
174
175 vias = of_find_node_by_name(NULL, "via-cuda");
176 if (vias == NULL)
177 vias = of_find_node_by_name(NULL, "via-pmu");
178 if (vias == NULL)
179 vias = of_find_node_by_name(NULL, "via");
180 if (vias == NULL || of_address_to_resource(vias, 0, &rsrc)) {
181 of_node_put(vias);
182 return 0;
183 }
184 of_node_put(vias);
185 via = early_ioremap(rsrc.start, resource_size(&rsrc));
186 if (via == NULL) {
187 printk(KERN_ERR "Failed to map VIA for timer calibration !\n");
188 return 0;
189 }
190
191 /* set timer 1 for continuous interrupts */
192 out_8(&via[ACR], (via[ACR] & ~T1MODE) | T1MODE_CONT);
193 /* set the counter to a small value */
194 out_8(&via[T1CH], 2);
195 /* set the latch to `count' */
196 out_8(&via[T1LL], count);
197 out_8(&via[T1LH], count >> 8);
198 /* wait until it hits 0 */
199 while ((in_8(&via[IFR]) & T1_INT) == 0)
200 ;
201 dstart = get_dec();
202 /* clear the interrupt & wait until it hits 0 again */
203 in_8(&via[T1CL]);
204 while ((in_8(&via[IFR]) & T1_INT) == 0)
205 ;
206 dend = get_dec();
207
208 ppc_tb_freq = (dstart - dend) * 100 / 6;
209
> 210 early_iounmap((void *)via, resource_size(&rsrc));
211
212 return 1;
213 }
214 #endif
215
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-08-07 2:59 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=202308071025.KCEf7Mhd-lkp@intel.com \
--to=lkp@intel.com \
--cc=bgray@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=oe-kbuild-all@lists.linux.dev \
/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.