[groeck-staging:hwmon-next 32/37] drivers/hwmon/ina2xx.c:734:8: error: duplicate case value: 'hwmon_in_input' and 'hwmon_power_average' both equal '1'

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head:   33c7c88cd30fa65f5479722ba7eea300ebf889a5
commit: 8fb186818c2fe7be4e2f722c1bc1108ec854d416 [32/37] hwmon: (ina226) Add support for SY24655
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20241108/202411082010.YVGQz3Xo-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241108/202411082010.YVGQz3Xo-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411082010.YVGQz3Xo-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from drivers/hwmon/ina2xx.c:31:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:8:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from drivers/hwmon/ina2xx.c:31:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:8:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from drivers/hwmon/ina2xx.c:31:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:8:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   In file included from drivers/hwmon/ina2xx.c:31:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   drivers/hwmon/ina2xx.c:524:15: warning: unused variable 'regval' [-Wunused-variable]
     524 |         unsigned int regval;
         |                      ^~~~~~
>> drivers/hwmon/ina2xx.c:734:8: error: duplicate case value: 'hwmon_in_input' and 'hwmon_power_average' both equal '1'
     734 |                 case hwmon_power_average:
         |                      ^
   drivers/hwmon/ina2xx.c:722:8: note: previous case defined here
     722 |                 case hwmon_in_input:
         |                      ^
   8 warnings and 1 error generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for MODVERSIONS
   Depends on [n]: MODULES [=y] && !COMPILE_TEST [=y]
   Selected by [y]:
   - RANDSTRUCT_FULL [=y] && (CC_HAS_RANDSTRUCT [=y] || GCC_PLUGINS [=n]) && MODULES [=y]
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [m]:
   - RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]


vim +734 drivers/hwmon/ina2xx.c

   710	
   711	static umode_t ina2xx_is_visible(const void *_data, enum hwmon_sensor_types type,
   712					 u32 attr, int channel)
   713	{
   714		const struct ina2xx_data *data = _data;
   715		bool has_alerts = data->config->has_alerts;
   716		bool has_power_average = data->config->has_power_average;
   717		enum ina2xx_ids chip = data->chip;
   718	
   719		switch (type) {
   720		case hwmon_in:
   721			switch (attr) {
   722			case hwmon_in_input:
   723				return 0444;
   724			case hwmon_in_lcrit:
   725			case hwmon_in_crit:
   726				if (has_alerts)
   727					return 0644;
   728				break;
   729			case hwmon_in_lcrit_alarm:
   730			case hwmon_in_crit_alarm:
   731				if (has_alerts)
   732					return 0444;
   733				break;
 > 734			case hwmon_power_average:
   735				if (has_power_average)
   736					return 0444;
   737				break;
   738			default:
   739				break;
   740			}
   741			break;
   742		case hwmon_curr:
   743			switch (attr) {
   744			case hwmon_curr_input:
   745				return 0444;
   746			case hwmon_curr_lcrit:
   747			case hwmon_curr_crit:
   748				if (has_alerts)
   749					return 0644;
   750				break;
   751			case hwmon_curr_lcrit_alarm:
   752			case hwmon_curr_crit_alarm:
   753				if (has_alerts)
   754					return 0444;
   755				break;
   756			default:
   757				break;
   758			}
   759			break;
   760		case hwmon_power:
   761			switch (attr) {
   762			case hwmon_power_input:
   763				return 0444;
   764			case hwmon_power_crit:
   765				if (has_alerts)
   766					return 0644;
   767				break;
   768			case hwmon_power_crit_alarm:
   769				if (has_alerts)
   770					return 0444;
   771				break;
   772			default:
   773				break;
   774			}
   775			break;
   776		case hwmon_chip:
   777			switch (attr) {
   778			case hwmon_chip_update_interval:
   779				if (chip == ina226 || chip == ina260)
   780					return 0644;
   781				break;
   782			default:
   783				break;
   784			}
   785			break;
   786		default:
   787			break;
   788		}
   789		return 0;
   790	}
   791	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux