Re: [PATCH 2/3] iio: pressure: bmp280: Add support for BMP380 sensor family

From: Angel Iglesias
Date: Mon Jun 27 2022 - 10:48:19 EST


On lun, 2022-06-27 at 10:37 +0300, Dan Carpenter wrote:
> Hi Angel,
>
> url:   
> https://github.com/intel-lab-lkp/linux/commits/Angel-Iglesias/dt-bindings-iio-pressure-bmp085-Add-BMP380-compatible-string/20220625-231424
> base:  
> https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
> config: i386-randconfig-m021
> compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> smatch warnings:
> drivers/iio/pressure/bmp280-core.c:1000 bmp380_chip_config() warn:
> should this be a bitwise op?
>
> vim +1000 drivers/iio/pressure/bmp280-core.c
>
> 56e3f8aecddacd Angel Iglesias 2022-06-25   988          if (ret < 0)
> {
> 56e3f8aecddacd Angel Iglesias 2022-06-25  
> 989                  dev_err(data->dev, "failed to write config
> register\n");
> 56e3f8aecddacd Angel Iglesias 2022-06-25  
> 990                  return ret;
> 56e3f8aecddacd Angel Iglesias 2022-06-25   991          }
> 56e3f8aecddacd Angel Iglesias 2022-06-25   992 
> 56e3f8aecddacd Angel Iglesias 2022-06-25   993          /* check
> config error flag */
> 56e3f8aecddacd Angel Iglesias 2022-06-25   994          ret =
> regmap_read(data->regmap, BMP380_REG_ERROR, &tmp);
> 56e3f8aecddacd Angel Iglesias 2022-06-25   995          if (ret < 0)
> {
> 56e3f8aecddacd Angel Iglesias 2022-06-25  
> 996                  dev_err(data->dev,
> 56e3f8aecddacd Angel Iglesias 2022-06-25  
> 997                          "failed to read error register\n");
> 56e3f8aecddacd Angel Iglesias 2022-06-25  
> 998                  return ret;
> 56e3f8aecddacd Angel Iglesias 2022-06-25   999          }
> 56e3f8aecddacd Angel Iglesias 2022-06-25 @1000          if (tmp &&
> BMP380_ERR_CONF_MASK) {
>                                                                
> ^^^^^^^^^^^^^^^^^^^^^^^
> Looks like & BMP380_ERR_CONF_MASK was intended.
>
> 56e3f8aecddacd Angel Iglesias 2022-06-25 
> 1001                  dev_warn(data->dev,
> 56e3f8aecddacd Angel Iglesias 2022-06-25 
> 1002                           "sensor flagged configuration as
> incompatible\n");
> 56e3f8aecddacd Angel Iglesias 2022-06-25  1003                  ret =
> -EINVAL;
> 56e3f8aecddacd Angel Iglesias 2022-06-25  1004          }
> 56e3f8aecddacd Angel Iglesias 2022-06-25  1005 
> 56e3f8aecddacd Angel Iglesias 2022-06-25  1006          return ret;
> 56e3f8aecddacd Angel Iglesias 2022-06-25  1007  }
>
Thanks! that is an awkward mistake, my bad!