lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e39d279-b981-4735-9a5a-f28069474d5f@kernel.org>
Date: Fri, 20 Jun 2025 07:49:16 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: liquancin.mereenamathai@...bosch.com, linux-iio@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, jic23@...nel.org, dlechner@...libre.com,
 nuno.sa@...log.com, andy@...nel.org, vassilisamir@...il.com,
 marcelo.schmitt1@...il.com, javier.carrasco.cruz@...il.com,
 Xu.Zhang@...bosch.com, Maoting.Bian@...bosch.com
Subject: Re: [PATCH v1 1/2] Add the iio driver for bosch pressure sensor
 bmp390. The bmp390 is a pressure sensor module. It will support SPI and I2C
 protocol based on configuration.

On 20/06/2025 06:54, liquancin.mereenamathai@...bosch.com wrote:
> From: Liquancin Mereena Mathai <liquancin.mereenamathai@...bosch.com>
> 
> Implemented features:
> * raw data access for pressure and temp through sysfs
> * iio buffer tool support for continuous sampling
> 
> Signed-off-by: Liquancin Mereena Mathai <liquancin.mereenamathai@...bosch.com>
> ---
>  MAINTAINERS                                   |    7 +
>  drivers/iio/pressure/Kconfig                  |   26 +
>  drivers/iio/pressure/Makefile                 |    1 +
>  drivers/iio/pressure/bmp390/Kconfig           |   29 +
>  drivers/iio/pressure/bmp390/Makefile          |   32 +
>  drivers/iio/pressure/bmp390/bmp3.c            | 2781 +++++++++++++++++
>  drivers/iio/pressure/bmp390/bmp3.h            |  537 ++++
>  drivers/iio/pressure/bmp390/bmp390_driver.c   | 1604 ++++++++++
>  drivers/iio/pressure/bmp390/bmp390_driver.h   |  232 ++
>  drivers/iio/pressure/bmp390/bmp390_i2c.c      |  328 ++
>  .../iio/pressure/bmp390/bmp390_iio_buffer.c   |  220 ++
>  drivers/iio/pressure/bmp390/bmp390_spi.c      |  286 ++
>  drivers/iio/pressure/bmp390/bmp3_defs.h       |  871 ++++++
>  drivers/iio/pressure/bmp390/bmp3_selftest.c   |  184 ++
>  drivers/iio/pressure/bmp390/bmp3_selftest.h   |   93 +
>  15 files changed, 7231 insertions(+)
>  create mode 100644 drivers/iio/pressure/bmp390/Kconfig
>  create mode 100644 drivers/iio/pressure/bmp390/Makefile
>  create mode 100644 drivers/iio/pressure/bmp390/bmp3.c
>  create mode 100644 drivers/iio/pressure/bmp390/bmp3.h
>  create mode 100644 drivers/iio/pressure/bmp390/bmp390_driver.c
>  create mode 100644 drivers/iio/pressure/bmp390/bmp390_driver.h
>  create mode 100644 drivers/iio/pressure/bmp390/bmp390_i2c.c
>  create mode 100644 drivers/iio/pressure/bmp390/bmp390_iio_buffer.c
>  create mode 100644 drivers/iio/pressure/bmp390/bmp390_spi.c
>  create mode 100644 drivers/iio/pressure/bmp390/bmp3_defs.h
>  create mode 100644 drivers/iio/pressure/bmp390/bmp3_selftest.c
>  create mode 100644 drivers/iio/pressure/bmp390/bmp3_selftest.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 1abec3f7d42b..f962f64d9a9e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -27447,6 +27447,13 @@ S:	Maintained
>  T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
>  F:	sound/pci/hda/patch_senarytech.c
>  
> +BOSCH SENSORTEC BMP390 PRESSURE IIO DRIVER
> +M:	Liquancin Mereena Mathai <liquancin.mereenamathai@...bosch.com>
> +L:	linux-iio@...r.kernel.org
> +S:	Maintained
> +F:	Documentation/devicetree/bindings/iio/pressure/bosch,bmp390.yaml
> +F:	drivers/iio/pressure/bmp390/*
> +
>  THE REST
>  M:	Linus Torvalds <torvalds@...ux-foundation.org>
>  L:	linux-kernel@...r.kernel.org
> diff --git a/drivers/iio/pressure/Kconfig b/drivers/iio/pressure/Kconfig
> index d2cb8c871f6a..ffa5a1c76e06 100644
> --- a/drivers/iio/pressure/Kconfig
> +++ b/drivers/iio/pressure/Kconfig
> @@ -6,6 +6,32 @@
>  
>  menu "Pressure sensors"
>  
> +menu "Bosch BMP390 pressure sensor driver"
> +config BMP390_IIO
> +    tristate "Bosch BMP390 pressure sensor driver"
> +    depends on IIO
> +    help
> +      Say yes here to build support for the Bosch BMP390 pressure sensor.
> +
> +
> +      The Bosch BMP390 is a high-precision, low-power digital pressure sensor

Messed indentation. Look at other entries - what is the indentation there?

> +      designed for a wide range of applications, including weather monitoring,
> +      altitude tracking, and indoor navigation. This driver provides support
> +      for interfacing with the BMP390 sensor through the Industrial I/O (IIO)
> +      subsystem.
> +
> +      If you choose to compile this driver as a module, it will be named
> +      'bmp390'. This allows the driver to be dynamically loaded and unloaded
> +      as needed, providing flexibility in managing the sensor.
> +
> +      To compile this driver as a module, choose M here: the module will be
> +      called bmp390. If you are unsure, it is safe to say 'N' here.
> +



...

> +
> diff --git a/drivers/iio/pressure/bmp390/bmp3_selftest.h b/drivers/iio/pressure/bmp390/bmp3_selftest.h
> new file mode 100644
> index 000000000000..ab6c4a992011
> --- /dev/null
> +++ b/drivers/iio/pressure/bmp390/bmp3_selftest.h
> @@ -0,0 +1,93 @@
> +/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
> +/**
> + * @section LICENSE
> + * Copyright (c) 2024 Bosch Sensortec GmbH All Rights Reserved.
> + *
> + * This software program is licensed subject to the GNU General
> + * Public License (GPL).Version 2,June 1991,
> + * available at http://www.fsf.org/copyleft/gpl.html
> + *
> + * @file		bmp3_selftest.h
> + * @date		2024-12-04
> + * @version		v2.1.0
> + *

Again...

> + */
> +
> +#ifndef BMP38X_SELFTEST_H_
> +#define BMP38X_SELFTEST_H_
> +
> +/*! CPP guard */
> +#ifdef __cplusplus
> +extern "C" {
> +#endif

No. We don't do C++ in the kernel. Don't upstream your user-space driver
or any other code looking 100% different than everything else in the
kernel. Instead take existing, most recent, reviewed kernel driver and
use it as starting point.

Entire driver has poor style, with these javadoc or doxygen annotations.
Or useless comments like "static functions declaration". That's not kernel.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ