linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [hwmon:hwmon-playground 3/12] drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'}
@ 2020-02-02  7:46 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-02-02  7:46 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: kbuild-all, linux-hwmon

[-- Attachment #1: Type: text/plain, Size: 5522 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-playground
head:   4e5fc259a7d202d7e13818052a6cdaff0f602b35
commit: 4e87220ea3c48bcb3aeadc4000acf9bcc7aa7522 [3/12] hwmon: (pmbus) Implement multi-phase support
config: arc-randconfig-a001-20200202 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 4e87220ea3c48bcb3aeadc4000acf9bcc7aa7522
        # save the attached .config to linux build tree
        GCC_VERSION=9.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_clear_faults':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_read_byte_data':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_write_byte':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_write_word_data':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_write_byte_data':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_update_byte_data':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_update_fan':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_read_status_byte':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function 'pmbus_debugfs_get':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/hwmon//pmbus/pmbus_core.c: In function '_pmbus_read_byte_data':
>> drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} [-Warray-bounds]
     175 |      !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
         |        ~~~~~~~~~~~~~~~~~^~~~~~~

vim +175 drivers/hwmon//pmbus/pmbus_core.c

   150	
   151	int pmbus_set_page(struct i2c_client *client, int page, int phase)
   152	{
   153		struct pmbus_data *data = i2c_get_clientdata(client);
   154		int rv;
   155	
   156		if (page < 0)
   157			return 0;
   158	
   159		if (!(data->info->func[page] & PMBUS_PAGE_VIRTUAL) &&
   160		    data->info->pages > 1 && page != data->currpage) {
   161			rv = i2c_smbus_write_byte_data(client, PMBUS_PAGE, page);
   162			if (rv < 0)
   163				return rv;
   164	
   165			rv = i2c_smbus_read_byte_data(client, PMBUS_PAGE);
   166			if (rv < 0)
   167				return rv;
   168	
   169			if (rv != page)
   170				return -EIO;
   171		}
   172		data->currpage = page;
   173	
   174		if (data->info->phases && data->currphase != phase &&
 > 175		    !(data->info->pfunc[phase] & PMBUS_PHASE_VIRTUAL)) {
   176			rv = i2c_smbus_write_byte_data(client, PMBUS_PHASE,
   177						       phase);
   178			if (rv)
   179				return rv;
   180		}
   181		data->currphase = phase;
   182	
   183		return 0;
   184	}
   185	EXPORT_SYMBOL_GPL(pmbus_set_page);
   186	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33054 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-02  7:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-02  7:46 [hwmon:hwmon-playground 3/12] drivers/hwmon//pmbus/pmbus_core.c:175:25: warning: array subscript 255 is above array bounds of 'const u32[8]' {aka 'const unsigned int[8]'} 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;
as well as URLs for NNTP newsgroup(s).