devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: marius.cristea@microchip.com, jic23@kernel.org, lars@metafoo.de,
	robh+dt@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	marius.cristea@microchip.com
Subject: Re: [PATCH v1 2/2] iio: adc: adding support for pac193x
Date: Tue, 21 Feb 2023 05:36:23 +0800	[thread overview]
Message-ID: <202302210551.5yGSdcbc-lkp@intel.com> (raw)
In-Reply-To: <20230220123232.413029-3-marius.cristea@microchip.com>

Hi,

I love your patch! Perhaps something to improve:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.2 next-20230220]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/marius-cristea-microchip-com/dt-bindings-iio-adc-adding-dt-bindings-for-PAC193X/20230220-203540
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20230220123232.413029-3-marius.cristea%40microchip.com
patch subject: [PATCH v1 2/2] iio: adc: adding support for pac193x
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20230221/202302210551.5yGSdcbc-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/fd3be916ffe18735a98bdc55ccc0cb5f3097582c
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review marius-cristea-microchip-com/dt-bindings-iio-adc-adding-dt-bindings-for-PAC193X/20230220-203540
        git checkout fd3be916ffe18735a98bdc55ccc0cb5f3097582c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202302210551.5yGSdcbc-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/iio/adc/pac193x.c: In function 'pac193x_acpi_get_acpi_match_entry':
   drivers/iio/adc/pac193x.c:1402:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
    1402 |         acpi_status status;
         |                     ^~~~~~
   drivers/iio/adc/pac193x.c: In function 'pac193x_match_acpi_device':
>> drivers/iio/adc/pac193x.c:1469:57: warning: '<<' in boolean context, did you mean '<'? [-Wint-in-bool-context]
    1469 |         chip_info->bi_dir[0] = (bi_dir_mask & (1 << 1)) << 1;
         |                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   drivers/iio/adc/pac193x.c:1470:57: warning: '<<' in boolean context, did you mean '<'? [-Wint-in-bool-context]
    1470 |         chip_info->bi_dir[0] = (bi_dir_mask & (1 << 2)) << 2;
         |                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   drivers/iio/adc/pac193x.c:1471:57: warning: '<<' in boolean context, did you mean '<'? [-Wint-in-bool-context]
    1471 |         chip_info->bi_dir[0] = (bi_dir_mask & (1 << 3)) << 3;
         |                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~


vim +1469 drivers/iio/adc/pac193x.c

  1411	
  1412	static const char *pac193x_match_acpi_device(struct i2c_client *client,
  1413						     struct pac193x_chip_info *chip_info)
  1414	{
  1415		char *name;
  1416		acpi_handle handle;
  1417		union acpi_object *rez;
  1418		unsigned short bi_dir_mask;
  1419		int idx, i;
  1420	
  1421		handle = ACPI_HANDLE(&client->dev);
  1422		name = pac193x_acpi_get_acpi_match_entry(handle);
  1423		if (!name)
  1424			return NULL;
  1425	
  1426		rez = pac193x_acpi_eval_function(handle, 0, PAC193X_ACPI_GET_NAMES_AND_MOHMS_VALS);
  1427	
  1428		if (!rez)
  1429			return NULL;
  1430	
  1431		for (i = 0; i < rez->package.count; i += 2) {
  1432			idx = i / 2;
  1433			chip_info->channel_names[idx] =
  1434				devm_kmemdup(&client->dev, rez->package.elements[i].string.pointer,
  1435					     (size_t)rez->package.elements[i].string.length + 1,
  1436					     GFP_KERNEL);
  1437			chip_info->channel_names[idx][rez->package.elements[i].string.length] = '\0';
  1438			chip_info->shunts[idx] =
  1439				rez->package.elements[i + 1].integer.value * 1000;
  1440			chip_info->active_channels[idx] = (chip_info->shunts[idx] != 0);
  1441		}
  1442	
  1443		kfree(rez);
  1444	
  1445		rez = pac193x_acpi_eval_function(handle, 1, PAC193X_ACPI_GET_UOHMS_VALS);
  1446		if (!rez) {
  1447			/*
  1448			 * initialising with default values
  1449			 * we assume all channels are unidectional(the mask is zero)
  1450			 * and assign the default sampling rate
  1451			 */
  1452			chip_info->sample_rate_value = PAC193X_DEFAULT_CHIP_SAMP_SPEED;
  1453			return name;
  1454		}
  1455	
  1456		for (i = 0; i < rez->package.count; i++) {
  1457			idx = i;
  1458			chip_info->shunts[idx] = rez->package.elements[i].integer.value;
  1459			chip_info->active_channels[idx] = (chip_info->shunts[idx] != 0);
  1460		}
  1461	
  1462		kfree(rez);
  1463	
  1464		rez = pac193x_acpi_eval_function(handle, 1, PAC193X_ACPI_GET_BIPOLAR_SETTINGS);
  1465		if (!rez)
  1466			return NULL;
  1467		bi_dir_mask = rez->package.elements[0].integer.value;
  1468		chip_info->bi_dir[0] = (bi_dir_mask & (1 << 0)) << 0;
> 1469		chip_info->bi_dir[0] = (bi_dir_mask & (1 << 1)) << 1;
  1470		chip_info->bi_dir[0] = (bi_dir_mask & (1 << 2)) << 2;
  1471		chip_info->bi_dir[0] = (bi_dir_mask & (1 << 3)) << 3;
  1472		kfree(rez);
  1473	
  1474		rez = pac193x_acpi_eval_function(handle, 1, PAC193X_ACPI_GET_SAMP);
  1475		if (!rez)
  1476			return NULL;
  1477	
  1478		chip_info->sample_rate_value = rez->package.elements[0].integer.value;
  1479		kfree(rez);
  1480	
  1481		return name;
  1482	}
  1483	

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

  parent reply	other threads:[~2023-02-20 21:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 12:32 [PATCH v1 0/2] adding support for Microchip PAC193X Power Monitor marius.cristea
2023-02-20 12:32 ` [PATCH v1 1/2] dt-bindings: iio: adc: adding dt-bindings for PAC193X marius.cristea
2023-02-21 13:44   ` Krzysztof Kozlowski
2023-02-25 17:17     ` Jonathan Cameron
2023-03-06 13:53       ` Marius.Cristea
2023-03-06 16:09         ` Krzysztof Kozlowski
2023-03-06 16:26         ` Jonathan Cameron
2023-02-20 12:32 ` [PATCH v1 2/2] iio: adc: adding support for pac193x marius.cristea
2023-02-20 20:04   ` kernel test robot
2023-02-20 21:36   ` kernel test robot [this message]
2023-02-21 13:46   ` Krzysztof Kozlowski
2023-02-25 17:19     ` Jonathan Cameron
2023-02-25 17:22       ` Jonathan Cameron
2023-03-06 13:56         ` Marius.Cristea
2023-02-25 19:27   ` Jonathan Cameron
2023-03-06 15:42     ` Marius.Cristea
2023-03-12 16:42       ` Jonathan Cameron
2023-03-23 15:15         ` Marius.Cristea
2023-03-25 18:06           ` Jonathan Cameron
2023-02-25 17:11 ` [PATCH v1 0/2] adding support for Microchip PAC193X Power Monitor Jonathan Cameron
2023-03-06 14:03   ` Marius.Cristea
2023-03-12 16:45     ` Jonathan Cameron

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=202302210551.5yGSdcbc-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marius.cristea@microchip.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).