Re: [PATCH v4 02/11] iio: adc: Add basic support for AD4170

From: kernel test robot
Date: Tue Jun 03 2025 - 10:01:33 EST


Hi Marcelo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on c06335516e8c14f501a479a4d9de0e6c09c52ef2]

url: https://github.com/intel-lab-lkp/linux/commits/Marcelo-Schmitt/dt-bindings-iio-adc-Add-AD4170/20250603-105744
base: c06335516e8c14f501a479a4d9de0e6c09c52ef2
patch link: https://lore.kernel.org/r/e79f9a126672b33b8a7c01f650fee43a68c74029.1748829860.git.marcelo.schmitt%40analog.com
patch subject: [PATCH v4 02/11] iio: adc: Add basic support for AD4170
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20250603/202506032131.wuzW0a3k-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250603/202506032131.wuzW0a3k-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506032131.wuzW0a3k-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/iio/adc/ad4170.c: In function 'ad4170_parse_reference':
>> drivers/iio/adc/ad4170.c:1130:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
1130 | int ret;
| ^~~


vim +/ret +1130 drivers/iio/adc/ad4170.c

1124
1125 static int ad4170_parse_reference(struct ad4170_state *st,
1126 struct fwnode_handle *child,
1127 struct ad4170_setup *setup)
1128 {
1129 struct device *dev = &st->spi->dev;
> 1130 int ret;
1131 u32 aux;
1132
1133 /* Optional positive reference buffering */
1134 aux = AD4170_REF_BUF_FULL; /* Default to full precharge buffer enabled. */
1135 fwnode_property_read_u32(child, "adi,positive-reference-buffer", &aux);
1136 if (aux < AD4170_REF_BUF_PRE || aux > AD4170_REF_BUF_BYPASS)
1137 return dev_err_probe(dev, -EINVAL,
1138 "Invalid adi,positive-reference-buffer: %u\n",
1139 aux);
1140
1141 setup->afe |= FIELD_PREP(AD4170_AFE_REF_BUF_P_MSK, aux);
1142
1143 /* Optional negative reference buffering */
1144 aux = AD4170_REF_BUF_FULL; /* Default to full precharge buffer enabled. */
1145 fwnode_property_read_u32(child, "adi,negative-reference-buffer", &aux);
1146 if (aux < AD4170_REF_BUF_PRE || aux > AD4170_REF_BUF_BYPASS)
1147 return dev_err_probe(dev, -EINVAL,
1148 "Invalid adi,negative-reference-buffer: %u\n",
1149 aux);
1150
1151 setup->afe |= FIELD_PREP(AD4170_AFE_REF_BUF_M_MSK, aux);
1152
1153 /* Optional voltage reference selection */
1154 aux = AD4170_REF_REFOUT; /* Default reference selection. */
1155 ret = fwnode_property_read_u32(child, "adi,reference-select", &aux);
1156 if (aux > AD4170_REF_AVDD)
1157 return dev_err_probe(dev, -EINVAL,
1158 "Invalid reference selected %u\n",
1159 aux);
1160
1161 setup->afe |= FIELD_PREP(AD4170_AFE_REF_SELECT_MSK, aux);
1162
1163 return 0;
1164 }
1165

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