* [next:master 6753/6952] drivers/hwmon/w83795.c:312:16: sparse: incorrect type in initializer (different modifiers)
@ 2015-03-25 10:25 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2015-03-25 10:25 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: kbuild-all, Andrew Morton, Linux Memory Management List
tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b2dfdab2f61ed5eb57317136d6efbb973f79210e
commit: f8e5b425f5eea40759a0ccc17caa7f4d660d0d4a [6753/6952] hwmon: (w83795) use find_closest_descending() in pwm_freq_to_reg()
reproduce:
# apt-get install sparse
git checkout f8e5b425f5eea40759a0ccc17caa7f4d660d0d4a
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
>> drivers/hwmon/w83795.c:312:16: sparse: incorrect type in initializer (different modifiers)
drivers/hwmon/w83795.c:312:16: expected unsigned short *__fc_a
drivers/hwmon/w83795.c:312:16: got unsigned short static const [toplevel] *<noident>
vim +312 drivers/hwmon/w83795.c
296 unsigned long base_clock;
297
298 if (reg & 0x80) {
299 base_clock = clkin * 1000 / ((clkin == 48000) ? 384 : 256);
300 return base_clock / ((reg & 0x7f) + 1);
301 } else
302 return pwm_freq_cksel0[reg & 0x0f];
303 }
304
305 static u8 pwm_freq_to_reg(unsigned long val, u16 clkin)
306 {
307 unsigned long base_clock;
308 u8 reg0, reg1;
309 unsigned long best0, best1;
310
311 /* Best fit for cksel = 0 */
> 312 reg0 = find_closest_descending(val, pwm_freq_cksel0,
313 ARRAY_SIZE(pwm_freq_cksel0));
314 if (val < 375) /* cksel = 1 can't beat this */
315 return reg0;
316 best0 = pwm_freq_cksel0[reg0];
317
318 /* Best fit for cksel = 1 */
319 base_clock = clkin * 1000 / ((clkin == 48000) ? 384 : 256);
320 reg1 = clamp_val(DIV_ROUND_CLOSEST(base_clock, val), 1, 128);
---
0-DAY kernel test infrastructure Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-25 10:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 10:25 [next:master 6753/6952] drivers/hwmon/w83795.c:312:16: sparse: incorrect type in initializer (different modifiers) kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox