From: kernel test robot <lkp@intel.com>
To: Wenliang Yan <wenliang202407@163.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-hwmon@vger.kernel.org,
Guenter Roeck <linux@roeck-us.net>
Subject: [groeck-staging:hwmon-next 32/37] drivers/hwmon/ina2xx.c:734:17: error: duplicate case value
Date: Fri, 8 Nov 2024 15:16:20 +0800 [thread overview]
Message-ID: <202411081521.uiK1CM2g-lkp@intel.com> (raw)
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@intel.com/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@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/202411081521.uiK1CM2g-lkp@intel.com/
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
reply other threads:[~2024-11-08 7:16 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=202411081521.uiK1CM2g-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=wenliang202407@163.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox