From: kernel test robot <lkp@intel.com>
To: Angel Iglesias <ang.iglesiasg@gmail.com>,
Jonathan Cameron <jic23@kernel.org>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
Angel Iglesias <ang.iglesiasg@gmail.com>,
Lars-Peter Clausen <lars@metafoo.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Paul Cercueil <paul@crapouillou.net>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] iio: pressure: bmp280: Adds more tunable config parameters for BMP380
Date: Mon, 4 Jul 2022 10:32:09 +0800 [thread overview]
Message-ID: <202207041006.YJFp2Aj6-lkp@intel.com> (raw)
In-Reply-To: <20220704003337.208696-1-ang.iglesiasg@gmail.com>
Hi Angel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on 69cb6c6556ad89620547318439d6be8bb1629a5a]
url: https://github.com/intel-lab-lkp/linux/commits/Angel-Iglesias/Add-support-for-pressure-sensor-Bosch-BMP380/20220704-083456
base: 69cb6c6556ad89620547318439d6be8bb1629a5a
config: arm64-buildonly-randconfig-r001-20220703 (https://download.01.org/0day-ci/archive/20220704/202207041006.YJFp2Aj6-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 134363208b9272a967c911f7b56c255a72a6f0a0)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/b9905383fbc9858f211da589e86db6675f82f528
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Angel-Iglesias/Add-support-for-pressure-sensor-Bosch-BMP380/20220704-083456
git checkout b9905383fbc9858f211da589e86db6675f82f528
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/iio/pressure/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/iio/pressure/bmp280-core.c:1230:11: warning: variable 'change' is uninitialized when used here [-Wuninitialized]
change = change || aux;
^~~~~~
drivers/iio/pressure/bmp280-core.c:1205:13: note: initialize the variable 'change' to silence this warning
bool change, aux;
^
= 0
1 warning generated.
vim +/change +1230 drivers/iio/pressure/bmp280-core.c
1199
1200 static int bmp380_chip_config(struct bmp280_data *data)
1201 {
1202 u8 osrs;
1203 unsigned int tmp;
1204 int ret;
1205 bool change, aux;
1206
1207 /* configure power control register */
1208 ret = regmap_update_bits(data->regmap, BMP380_REG_POWER_CONTROL,
1209 BMP380_CTRL_SENSORS_MASK,
1210 BMP380_CTRL_SENSORS_PRESS_EN |
1211 BMP380_CTRL_SENSORS_TEMP_EN);
1212 if (ret < 0) {
1213 dev_err(data->dev,
1214 "failed to write operation control register\n");
1215 return ret;
1216 }
1217
1218 /* configure oversampling */
1219 osrs = FIELD_PREP(BMP380_OSRS_TEMP_MASK, data->oversampling_temp) |
1220 FIELD_PREP(BMP380_OSRS_PRESS_MASK, data->oversampling_press);
1221
1222 ret = regmap_update_bits_check(data->regmap, BMP380_REG_OSR,
1223 BMP380_OSRS_TEMP_MASK |
1224 BMP380_OSRS_PRESS_MASK,
1225 osrs, &aux);
1226 if (ret < 0) {
1227 dev_err(data->dev, "failed to write oversampling register\n");
1228 return ret;
1229 }
> 1230 change = change || aux;
1231
1232 /* configure output data rate */
1233 ret = regmap_update_bits_check(data->regmap, BMP380_REG_ODR,
1234 BMP380_ODRS_MASK, data->sampling_freq,
1235 &aux);
1236 if (ret < 0) {
1237 dev_err(data->dev, "failed to write ODR selection register\n");
1238 return ret;
1239 }
1240 change = change || aux;
1241
1242 /* set filter data */
1243 ret = regmap_update_bits_check(data->regmap, BMP380_REG_CONFIG,
1244 BMP380_FILTER_MASK,
1245 FIELD_PREP(BMP380_FILTER_MASK, data->iir_filter_coeff),
1246 &aux);
1247 if (ret < 0) {
1248 dev_err(data->dev, "failed to write config register\n");
1249 return ret;
1250 }
1251 change = change || aux;
1252
1253 if (change) {
1254 /* cycle sensor state machine to reset any measurement in progress
1255 * configuration errors are detected in a measurment cycle.
1256 * If the sampling frequency is too low, it is faster to reset
1257 * measurement cycle and restart measurements
1258 */
1259 ret = regmap_write_bits(data->regmap, BMP380_REG_POWER_CONTROL,
1260 BMP380_MODE_MASK,
1261 FIELD_PREP(BMP380_MODE_MASK,
1262 BMP380_MODE_SLEEP));
1263 if (ret < 0) {
1264 dev_err(data->dev, "failed to set sleep mode\n");
1265 return ret;
1266 }
1267 usleep_range(2000, 2500);
1268 ret = regmap_write_bits(data->regmap, BMP380_REG_POWER_CONTROL,
1269 BMP380_MODE_MASK,
1270 FIELD_PREP(BMP380_MODE_MASK,
1271 BMP380_MODE_NORMAL));
1272 if (ret < 0) {
1273 dev_err(data->dev, "failed to set normal mode\n");
1274 return ret;
1275 }
1276 /* wait before checking the configuration error flag.
1277 * Worst case value for measure time indicated in the datashhet
1278 * in section 3.9.1 is used.
1279 */
1280 msleep(80);
1281
1282 /* check config error flag */
1283 ret = regmap_read(data->regmap, BMP380_REG_ERROR, &tmp);
1284 if (ret < 0) {
1285 dev_err(data->dev,
1286 "failed to read error register\n");
1287 return ret;
1288 }
1289 if (tmp & BMP380_ERR_CONF_MASK) {
1290 dev_warn(data->dev,
1291 "sensor flagged configuration as incompatible\n");
1292 return -EINVAL;
1293 }
1294 }
1295
1296 return 0;
1297 }
1298
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-07-04 2:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 0:33 [PATCH v2 5/5] iio: pressure: bmp280: Adds more tunable config parameters for BMP380 Angel Iglesias
2022-07-04 2:32 ` kernel test robot [this message]
2022-07-04 20:08 ` Andy Shevchenko
2022-07-05 22:51 ` Angel Iglesias
2022-07-06 12:42 ` Andy Shevchenko
2022-07-06 14:39 ` Angel Iglesias
2022-07-06 17:49 ` Andy Shevchenko
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=202207041006.YJFp2Aj6-lkp@intel.com \
--to=lkp@intel.com \
--cc=ang.iglesiasg@gmail.com \
--cc=jic23@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=paul@crapouillou.net \
--cc=rafael.j.wysocki@intel.com \
--cc=ulf.hansson@linaro.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 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.