public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Shen Jianping (ME-SE/EAD2)" <jianping.shen@de.bosch.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "Lorenz Christian (ME-SE/EAD2)" <Christian.Lorenz3@de.bosch.com>,
	"Dolde Kai (ME-SE/PAE-A3)" <Kai.Dolde@de.bosch.com>,
	"Frauendorf Ulrike (ME/PJ-SW3)" <Ulrike.Frauendorf@de.bosch.com>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"dima.fedrau@gmail.com" <dima.fedrau@gmail.com>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"marcelo.schmitt1@gmail.com" <marcelo.schmitt1@gmail.com>,
	"robh@kernel.org" <robh@kernel.org>
Subject: Re: [PATCH v2 2/2] iio: imu: smi240: imu driver
Date: Sat, 10 Aug 2024 14:45:49 +0200	[thread overview]
Message-ID: <f890d760-9610-4e6e-aa7e-4920e25e936b@kernel.org> (raw)
In-Reply-To: <AM8PR10MB47217E50E6A7E20DC5C89973CDBA2@AM8PR10MB4721.EURPRD10.PROD.OUTLOOK.COM>

On 09/08/2024 14:18, Shen Jianping (ME-SE/EAD2) wrote:
> Hi Christophe,
> 
> ....
>> +
>> +	data = iio_priv(indio_dev);
>> +	dev_set_drvdata(dev, indio_dev);
>> +	data->regmap = regmap;
>> +	data->capture = 0;
> 
> No need to explicitly initialize 'capture', devm_iio_device_alloc() already zeroes the allocated emmory.
> It doesn't hurt to be explicit, but why this field and not the other ones?
> 
> -> This is the flag to enable capture mode. It is important to be disabled by default, therefore rather make this explicitly.

It's redundant.

Anyway, it's not suppose to be uint8 anyway, but bool or enum.

Best regards,
Krzysztof


  reply	other threads:[~2024-08-10 12:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 11:16 [PATCH v2 0/2] iio: imu: smi240: cover-letter Jianping.Shen
2024-08-09 11:16 ` [PATCH v2 1/2] dt-bindings: iio: imu: smi240: devicetree binding Jianping.Shen
2024-08-09 14:19   ` Conor Dooley
2024-08-09 11:16 ` [PATCH v2 2/2] iio: imu: smi240: imu driver Jianping.Shen
2024-08-09 12:07   ` Christophe JAILLET
2024-08-09 12:18     ` Shen Jianping (ME-SE/EAD2)
2024-08-10 12:45       ` Krzysztof Kozlowski [this message]
2024-08-12 10:13         ` Shen Jianping (ME-SE/EAD2)
2024-08-10 12:44   ` Krzysztof Kozlowski
2024-08-13  9:41     ` Shen Jianping (ME-SE/EAD2)
2024-08-13  9:46       ` Krzysztof Kozlowski
2024-08-13 13:54         ` Shen Jianping (ME-SE/EAD2)
2024-08-13 14:37           ` Krzysztof Kozlowski
2024-08-13 14:51             ` Shen Jianping (ME-SE/EAD2)
2024-08-13 15:53               ` Krzysztof Kozlowski
2024-08-13 15:59       ` Krzysztof Kozlowski
2024-08-14 11:22         ` Shen Jianping (ME-SE/EAD2)
2024-08-13 15:57   ` Krzysztof Kozlowski

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=f890d760-9610-4e6e-aa7e-4920e25e936b@kernel.org \
    --to=krzk@kernel.org \
    --cc=Christian.Lorenz3@de.bosch.com \
    --cc=Kai.Dolde@de.bosch.com \
    --cc=Ulrike.Frauendorf@de.bosch.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dima.fedrau@gmail.com \
    --cc=jianping.shen@de.bosch.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=robh@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox