[groeck-staging:hwmon-next 32/37] drivers/hwmon/ina2xx.c:734:17: error: duplicate case value

[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: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20241108/202411081521.uiK1CM2g-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241108/202411081521.uiK1CM2g-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/202411081521.uiK1CM2g-lkp@xxxxxxxxx/

All error/warnings (new ones prefixed by >>):

   drivers/hwmon/ina2xx.c: In function 'sy24655_average_power_read':
>> drivers/hwmon/ina2xx.c:524:22: warning: unused variable 'regval' [-Wunused-variable]
     524 |         unsigned int regval;
         |                      ^~~~~~
   drivers/hwmon/ina2xx.c: In function 'ina2xx_is_visible':
>> drivers/hwmon/ina2xx.c:734:17: error: duplicate case value
     734 |                 case hwmon_power_average:
         |                 ^~~~
   drivers/hwmon/ina2xx.c:722:17: note: previously used here
     722 |                 case hwmon_in_input:
         |                 ^~~~


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