public inbox for linux-iio@vger.kernel.org
 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, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, 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 PAC194X
Date: Sun, 21 Jul 2024 00:30:12 +0800	[thread overview]
Message-ID: <202407210028.rJXFbiBg-lkp@intel.com> (raw)
In-Reply-To: <20240719173855.53261-3-marius.cristea@microchip.com>

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.10 next-20240719]
[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-support-for-PAC194X/20240720-014249
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20240719173855.53261-3-marius.cristea%40microchip.com
patch subject: [PATCH v1 2/2] iio: adc: adding support for PAC194X
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20240721/202407210028.rJXFbiBg-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240721/202407210028.rJXFbiBg-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/202407210028.rJXFbiBg-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/iio/adc/pac1944.c: In function 'pac1944_prep_custom_attributes':
>> drivers/iio/adc/pac1944.c:2048:23: warning: variable 'idx' set but not used [-Wunused-but-set-variable]
    2048 |         int ch, i, j, idx;
         |                       ^~~


vim +/idx +2048 drivers/iio/adc/pac1944.c

  2044	
  2045	static int pac1944_prep_custom_attributes(struct pac1944_chip_info *info,
  2046						  struct iio_dev *indio_dev)
  2047	{
> 2048		int ch, i, j, idx;
  2049		int active_channels_count = 0;
  2050		struct attribute **pac1944_custom_attrs, **tmp_attr;
  2051		struct attribute_group *pac1944_group;
  2052		int custom_attr_cnt;
  2053		struct i2c_client *client = info->client;
  2054	
  2055		for (i = 0 ; i < info->phys_channels; i++)
  2056			if (info->active_channels[i])
  2057				active_channels_count++;
  2058	
  2059		pac1944_group = devm_kzalloc(&client->dev, sizeof(*pac1944_group), GFP_KERNEL);
  2060		if (!pac1944_group)
  2061			return -ENOMEM;
  2062	
  2063		/*
  2064		 * Attributes for channel X:
  2065		 *	- in_shunt_value_X
  2066		 *	- in_oc_limit_nsamples
  2067		 *	- in_uc_limit_nsamples
  2068		 *	- in_op_limit_nsamples
  2069		 *	- in_ov_limit_nsamples
  2070		 *	- in_uv_limit_nsamples
  2071		 *	- one of pair attributes:
  2072		 *		- in_power_accX_raw and in_power_accX_scale
  2073		 *		- in_current_accX_raw and in_current_accX_scale
  2074		 *		- in_voltage_accX_raw and in_voltage_accX_scale
  2075		 * Shared attributes:
  2076		 *	- in_acc_fullness
  2077		 *	- in_alert_enable
  2078		 *	- in_slow_alert1
  2079		 *	- gpio_alert2
  2080		 *	- out_alert_status
  2081		 * NULL
  2082		 */
  2083		custom_attr_cnt = PAC1944_COMMON_DEVATTR * active_channels_count;
  2084		custom_attr_cnt += PAC1944_ACC_DEVATTR * active_channels_count;
  2085		custom_attr_cnt += PAC1944_SHARED_DEVATTRS_COUNT;
  2086	
  2087		pac1944_custom_attrs = devm_kzalloc(&client->dev, custom_attr_cnt *
  2088						    sizeof(*pac1944_group) + 1, GFP_KERNEL);
  2089		if (!pac1944_custom_attrs)
  2090			return -ENOMEM;
  2091	
  2092		j = 0;
  2093		for (ch = 0 ; ch < info->phys_channels; ch++) {
  2094			if (!info->active_channels[ch])
  2095				continue;
  2096	
  2097			for (i = 0; i < PAC1944_COMMON_DEVATTR; i++)
  2098				pac1944_custom_attrs[j++] =
  2099					pac1944_all_attrs[PAC1944_COMMON_DEVATTR * ch + i];
  2100	
  2101			idx = ch;
  2102			switch (info->chip_reg_data.accumulation_mode[ch]) {
  2103			case PAC1944_ACCMODE_VPOWER:
  2104				tmp_attr = pac1944_power_acc_attr;
  2105				break;
  2106			case PAC1944_ACCMODE_VSENSE:
  2107				tmp_attr = pac1944_current_acc_attr;
  2108				break;
  2109			case PAC1944_ACCMODE_VBUS:
  2110				tmp_attr = pac1944_voltage_acc_attr;
  2111				break;
  2112			default:
  2113				return -EINVAL;
  2114			}
  2115	
  2116			pac1944_custom_attrs[j++] = tmp_attr[ch];
  2117			pac1944_custom_attrs[j++] = pac1944_power_acc_attr[PAC1944_MAX_CH + ch];
  2118			pac1944_custom_attrs[j++] = pac1944_power_acc_attr[2 * PAC1944_MAX_CH + ch];
  2119		}
  2120	
  2121		for (i = 0; i < PAC1944_SHARED_DEVATTRS_COUNT; i++)
  2122			pac1944_custom_attrs[j++] =
  2123				pac1944_all_attrs[PAC1944_COMMON_DEVATTR * PAC1944_MAX_CH + i];
  2124	
  2125		pac1944_group->attrs = pac1944_custom_attrs;
  2126		info->iio_info.attrs = pac1944_group;
  2127	
  2128		return 0;
  2129	}
  2130	

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

  parent reply	other threads:[~2024-07-20 16:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-19 17:38 [PATCH v1 0/2] adding support for Microchip PAC194X Power Monitor marius.cristea
2024-07-19 17:38 ` [PATCH v1 1/2] dt-bindings: iio: adc: adding support for PAC194X marius.cristea
2024-07-20 17:09   ` Jonathan Cameron
2024-07-20 18:36   ` Krzysztof Kozlowski
2024-07-19 17:38 ` [PATCH v1 2/2] " marius.cristea
2024-07-19 19:04   ` Christophe JAILLET
2024-07-20 13:40   ` kernel test robot
2024-07-20 16:30   ` kernel test robot [this message]
2024-07-20 19:11   ` 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=202407210028.rJXFbiBg-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.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