[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f890d760-9610-4e6e-aa7e-4920e25e936b@kernel.org>
Date: Sat, 10 Aug 2024 14:45:49 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: "Shen Jianping (ME-SE/EAD2)" <jianping.shen@...bosch.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: "Lorenz Christian (ME-SE/EAD2)" <Christian.Lorenz3@...bosch.com>,
"Dolde Kai (ME-SE/PAE-A3)" <Kai.Dolde@...bosch.com>,
"Frauendorf Ulrike (ME/PJ-SW3)" <Ulrike.Frauendorf@...bosch.com>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"dima.fedrau@...il.com" <dima.fedrau@...il.com>,
"jic23@...nel.org" <jic23@...nel.org>,
"krzk+dt@...nel.org" <krzk+dt@...nel.org>, "lars@...afoo.de"
<lars@...afoo.de>, "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"marcelo.schmitt1@...il.com" <marcelo.schmitt1@...il.com>,
"robh@...nel.org" <robh@...nel.org>
Subject: Re: [PATCH v2 2/2] iio: imu: smi240: imu driver
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
Powered by blists - more mailing lists