Re: [PATCH v2 5/5] iio: pressure: bmp280: Adds more tunable config parameters for BMP380

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/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@xxxxxxxxx>

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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux