[next:master 6751/6952] drivers/hwmon/ina2xx.c:162:20: sparse: incorrect type in initializer (different modifiers)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b2dfdab2f61ed5eb57317136d6efbb973f79210e
commit: ef8e16b2c026a285a306ffb307810eecfc02f93c [6751/6952] hwmon: (ina2xx) replace ina226_avg_bits() with find_closest()
reproduce:
  # apt-get install sparse
  git checkout ef8e16b2c026a285a306ffb307810eecfc02f93c
  make ARCH=x86_64 allmodconfig
  make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/hwmon/ina2xx.c:162:20: sparse: incorrect type in initializer (different modifiers)
   drivers/hwmon/ina2xx.c:162:20:    expected int *__fc_a
   drivers/hwmon/ina2xx.c:162:20:    got int static const [toplevel] *<noident>

vim +162 drivers/hwmon/ina2xx.c

   146	{
   147		int avg = ina226_avg_tab[INA226_READ_AVG(config)];
   148	
   149		/*
   150		 * Multiply the total conversion time by the number of averages.
   151		 * Return the result in milliseconds.
   152		 */
   153		return DIV_ROUND_CLOSEST(avg * INA226_TOTAL_CONV_TIME_DEFAULT, 1000);
   154	}
   155	
   156	static u16 ina226_interval_to_reg(int interval, u16 config)
   157	{
   158		int avg, avg_bits;
   159	
   160		avg = DIV_ROUND_CLOSEST(interval * 1000,
   161					INA226_TOTAL_CONV_TIME_DEFAULT);
 > 162		avg_bits = find_closest(avg, ina226_avg_tab,
   163					ARRAY_SIZE(ina226_avg_tab));
   164	
   165		return (config & ~INA226_AVG_RD_MASK) | INA226_SHIFT_AVG(avg_bits);
   166	}
   167	
   168	static void ina226_set_update_interval(struct ina2xx_data *data)
   169	{
   170		int ms;

---
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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]