devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: kernel test robot <lkp@intel.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Rishi Gupta <gupt21@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] iio: light: add support for veml3235
Date: Fri, 25 Oct 2024 11:07:01 +0200	[thread overview]
Message-ID: <19c8e07f-4b9b-4d4b-aa18-f6766b65b33e@gmail.com> (raw)
In-Reply-To: <202410251610.kB7u6xMJ-lkp@intel.com>

On 25/10/2024 11:01, kernel test robot wrote:
> Hi Javier,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on ceab669fdf7b7510b4e4997b33d6f66e433a96db]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Javier-Carrasco/dt-bindings-iio-light-veml6030-add-veml3235/20241024-030144
> base:   ceab669fdf7b7510b4e4997b33d6f66e433a96db
> patch link:    https://lore.kernel.org/r/20241023-veml3235-v3-2-8490f2622f9a%40gmail.com
> patch subject: [PATCH v3 2/2] iio: light: add support for veml3235
> config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20241025/202410251610.kB7u6xMJ-lkp@intel.com/config)
> compiler: loongarch64-linux-gcc (GCC) 14.1.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410251610.kB7u6xMJ-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/202410251610.kB7u6xMJ-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/iio/light/veml3235.c: In function 'veml3235_set_it':
>>> drivers/iio/light/veml3235.c:148:26: warning: variable 'it_idx' set but not used [-Wunused-but-set-variable]
>      148 |         int ret, new_it, it_idx;
>          |                          ^~~~~~
>    drivers/iio/light/veml3235.c: In function 'veml3235_set_gain':
>>> drivers/iio/light/veml3235.c:191:28: warning: variable 'gain_idx' set but not used [-Wunused-but-set-variable]
>      191 |         int ret, new_gain, gain_idx;
>          |                            ^~~~~~~~
> 
> 
> vim +/it_idx +148 drivers/iio/light/veml3235.c
> 
>    144	
>    145	static int veml3235_set_it(struct iio_dev *indio_dev, int val, int val2)
>    146	{
>    147		struct veml3235_data *data = iio_priv(indio_dev);
>  > 148		int ret, new_it, it_idx;
>    149	
>    150		if (val)
>    151			return -EINVAL;
>    152	
>    153		switch (val2) {
>    154		case 50000:
>    155			new_it = 0x00;
>    156			it_idx = 4;
>    157			break;
>    158		case 100000:
>    159			new_it = 0x01;
>    160			it_idx = 3;
>    161			break;
>    162		case 200000:
>    163			new_it = 0x02;
>    164			it_idx = 2;
>    165			break;
>    166		case 400000:
>    167			new_it = 0x03;
>    168			it_idx = 1;
>    169			break;
>    170		case 800000:
>    171			new_it = 0x04;
>    172			it_idx = 0;
>    173			break;
>    174		default:
>    175			return -EINVAL;
>    176		}
>    177	
>    178		ret = regmap_field_write(data->rf.it, new_it);
>    179		if (ret) {
>    180			dev_err(data->dev,
>    181				"failed to update integration time: %d\n", ret);
>    182			return ret;
>    183		}
>    184	
>    185		return 0;
>    186	}
>    187	
>    188	static int veml3235_set_gain(struct iio_dev *indio_dev, int val, int val2)
>    189	{
>    190		struct veml3235_data *data = iio_priv(indio_dev);
>  > 191		int ret, new_gain, gain_idx;
>    192	
>    193		if (val2 != 0)
>    194			return -EINVAL;
>    195	
>    196		switch (val) {
>    197		case 1:
>    198			new_gain = 0x00;
>    199			gain_idx = 3;
>    200			break;
>    201		case 2:
>    202			new_gain = 0x01;
>    203			gain_idx = 2;
>    204			break;
>    205		case 4:
>    206			new_gain = 0x03;
>    207			gain_idx = 1;
>    208			break;
>    209		case 8:
>    210			new_gain = 0x07;
>    211			gain_idx = 0;
>    212			break;
>    213		default:
>    214			return -EINVAL;
>    215		}
>    216	
>    217		ret = regmap_field_write(data->rf.gain, new_gain);
>    218		if (ret) {
>    219			dev_err(data->dev, "failed to set gain: %d\n", ret);
>    220			return ret;
>    221		}
>    222	
>    223		return 0;
>    224	}
>    225	
> 


Unused as there is no processed values anymore. I will drop them for v4.

  reply	other threads:[~2024-10-25  9:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 18:59 [PATCH v3 0/2] iio: light: add support for veml3235 Javier Carrasco
2024-10-23 18:59 ` [PATCH v3 1/2] dt-bindings: iio: light: veml6030: add veml3235 Javier Carrasco
2024-10-23 18:59 ` [PATCH v3 2/2] iio: light: add support for veml3235 Javier Carrasco
2024-10-25  9:01   ` kernel test robot
2024-10-25  9:07     ` Javier Carrasco [this message]
2024-10-26 18:10       ` Jonathan Cameron
2024-10-27 12:23         ` Javier Carrasco

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=19c8e07f-4b9b-4d4b-aa18-f6766b65b33e@gmail.com \
    --to=javier.carrasco.cruz@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gupt21@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh@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).