All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [hwmon:hwmon-playground 3/12] drivers/hwmon/pmbus/pmbus_core.c:174:18: warning: address of array 'data->info->phases' will always evaluate to 'true'
       [not found] <202002031044.RnwQP6Bt%lkp@intel.com>
@ 2020-02-03 15:00 ` Nick Desaulniers
  2020-02-03 15:09   ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Desaulniers @ 2020-02-03 15:00 UTC (permalink / raw)
  To: kbuild-all

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

https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/commit/?h=hwmon-playground&id=ec31c1832ca6505f46d068e87a0524cd21e468b4

+ Guenter, looks legit, can you please take a look?  phases is an
array member of a struct, so it can never be NULL.

On Mon, Feb 3, 2020 at 2:55 AM kbuild test robot <lkp@intel.com> wrote:
>
> CC: kbuild-all(a)lists.01.org
> CC: linux-hwmon(a)vger.kernel.org
> TO: Guenter Roeck <linux@roeck-us.net>
>
> 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: x86_64-allyesconfig (attached as .config)
> compiler: clang version 11.0.0 (git://gitmirror/llvm_project ba8110161dfb096bbc63039afd87ff6417328f91)
> reproduce:
>         git checkout 4e87220ea3c48bcb3aeadc4000acf9bcc7aa7522
>         # save the attached .config to linux build tree
>         make ARCH=x86_64
>
> 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:174:18: warning: address of array 'data->info->phases' will always evaluate to 'true' [-Wpointer-bool-conversion]
>            if (data->info->phases && data->currphase != phase &&
>                ~~~~~~~~~~~~^~~~~~ ~~
>    1 warning generated.
>
> vim +174 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(a)lists.01.org Intel Corporation
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe(a)googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202002031044.RnwQP6Bt%25lkp%40intel.com.



-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [hwmon:hwmon-playground 3/12] drivers/hwmon/pmbus/pmbus_core.c:174:18: warning: address of array 'data->info->phases' will always evaluate to 'true'
  2020-02-03 15:00 ` [hwmon:hwmon-playground 3/12] drivers/hwmon/pmbus/pmbus_core.c:174:18: warning: address of array 'data->info->phases' will always evaluate to 'true' Nick Desaulniers
@ 2020-02-03 15:09   ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-02-03 15:09 UTC (permalink / raw)
  To: kbuild-all

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

On 2/3/20 7:00 AM, Nick Desaulniers wrote:
> https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/commit/?h=hwmon-playground&id=ec31c1832ca6505f46d068e87a0524cd21e468b4
> 
> + Guenter, looks legit, can you please take a look?  phases is an
> array member of a struct, so it can never be NULL.
> 

Hi Nick,

Thanks for the note; already reported twice or so ;-), and fixed.

Guenter

> On Mon, Feb 3, 2020 at 2:55 AM kbuild test robot <lkp@intel.com> wrote:
>>
>> CC: kbuild-all(a)lists.01.org
>> CC: linux-hwmon(a)vger.kernel.org
>> TO: Guenter Roeck <linux@roeck-us.net>
>>
>> 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: x86_64-allyesconfig (attached as .config)
>> compiler: clang version 11.0.0 (git://gitmirror/llvm_project ba8110161dfb096bbc63039afd87ff6417328f91)
>> reproduce:
>>          git checkout 4e87220ea3c48bcb3aeadc4000acf9bcc7aa7522
>>          # save the attached .config to linux build tree
>>          make ARCH=x86_64
>>
>> 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:174:18: warning: address of array 'data->info->phases' will always evaluate to 'true' [-Wpointer-bool-conversion]
>>             if (data->info->phases && data->currphase != phase &&
>>                 ~~~~~~~~~~~~^~~~~~ ~~
>>     1 warning generated.
>>
>> vim +174 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(a)lists.01.org Intel Corporation
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe(a)googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202002031044.RnwQP6Bt%25lkp%40intel.com.
> 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-03 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <202002031044.RnwQP6Bt%lkp@intel.com>
2020-02-03 15:00 ` [hwmon:hwmon-playground 3/12] drivers/hwmon/pmbus/pmbus_core.c:174:18: warning: address of array 'data->info->phases' will always evaluate to 'true' Nick Desaulniers
2020-02-03 15:09   ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.