From: Jonathan Cameron <jic23@kernel.org>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: "Sanjay Chitroda" <sanjayembeddedse@gmail.com>,
"Sanjay Chitroda via B4 Relay"
<devnull+sanjayembeddedse.gmail.com@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Jiri Kosina" <jikos@kernel.org>,
"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org,
"Maxwell Doose" <m32285159@gmail.com>
Subject: Re: [PATCH v2 3/6] iio: hid-sensors: Use implicit NULL pointer checks
Date: Sun, 5 Jul 2026 23:29:03 +0100 [thread overview]
Message-ID: <20260705232903.4a58c82b@jic23-huawei> (raw)
In-Reply-To: <CALoEA-wkbbvPA02JFCTuCEQrpGKZfu3NeBScTErTT07U7zJZ_g@mail.gmail.com>
On Sun, 5 Jul 2026 21:31:54 +0200
Joshua Crofts <joshua.crofts1@gmail.com> wrote:
> On Sun, 5 Jul 2026 at 20:17, Sanjay Chitroda <sanjayembeddedse@gmail.com> wrote:
> >
> >
> >
> > On 2 July 2026 10:52:05 pm IST, Jonathan Cameron <jic23@kernel.org> wrote:
> > >On Thu, 02 Jul 2026 21:48:00 +0530
> > >Sanjay Chitroda via B4 Relay <devnull+sanjayembeddedse.gmail.com@kernel.org> wrote:
> > >
> > >> From: Sanjay Chitroda <sanjayembeddedse@gmail.com>
> > >>
> > >> Replace explicit NULL pointer comparisons with implicit checks across
> > >> HID sensor IIO drivers to follow the preferred kernel coding style.
> > >Is there anything in the kernel wide style guides about this?
> > >
> > >I do prefer this style in IIO but perhaps we should document it
> > >as local IIO style rather than implying general guidance (unless
> > >there is some!)
> > >
> > Hi Jonathan,
> >
> > I took reference of existing IIO commit message and followed the same.
> >
> > There is no kernel coding guideline for NULL pointer. If you think it would be useful, I would be happy to work on documenting the preferred conventions under "Documentation/driver-api/iio/", for example as a new "coding-style.rst" or similar document.
>
Probably would go in a subsystem maintainer profile.
https://docs.kernel.org/maintainer/maintainer-entry-profile.html
If you want to take a stab at just a bit on local style preferences
that would be great. I can probably find time to throw something
together for other standard sections like timelines.
> Not sure whether any coding style kerneldoc mentions this style,
> nevertheless checkpatch prefers (!foo) over (foo == NULL), see the
> COMPARISON_TO_NULL section in the checkpatch kerneldoc.
>
Thanks for digging into this. If it got into checkpatch it was
reviewed and is generally accepted, whether or not anyone updated
the descriptive stuff on kernel style. Perhaps just refer to that
in the commit message to avoid confusion.
Thanks,
Jonathan
next prev parent reply other threads:[~2026-07-05 22:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 16:17 [PATCH v2 0/6] HID: iio: warning clean up and prefer kernel coding style Sanjay Chitroda via B4 Relay
2026-07-02 16:17 ` [PATCH v2 1/6] iio: hid-sensors: add/remove blank line Sanjay Chitroda via B4 Relay
2026-07-02 17:30 ` Jonathan Cameron
2026-07-02 16:17 ` [PATCH v2 2/6] iio: hid-sensors: align function parenthesis for readability Sanjay Chitroda via B4 Relay
2026-07-02 17:20 ` Jonathan Cameron
2026-07-03 12:52 ` Andy Shevchenko
2026-07-04 1:09 ` srinivas pandruvada
2026-07-04 23:07 ` Jonathan Cameron
2026-07-02 16:18 ` [PATCH v2 3/6] iio: hid-sensors: Use implicit NULL pointer checks Sanjay Chitroda via B4 Relay
2026-07-02 17:22 ` Jonathan Cameron
2026-07-05 18:17 ` Sanjay Chitroda
2026-07-05 19:31 ` Joshua Crofts
2026-07-05 22:29 ` Jonathan Cameron [this message]
2026-07-02 16:18 ` [PATCH v2 4/6] iio: humidity: hid-sensor-humidity: use common device for devres Sanjay Chitroda via B4 Relay
2026-07-02 17:26 ` Jonathan Cameron
2026-07-02 16:18 ` [PATCH v2 5/6] iio: position: hid-sensor-custom-intel-hinge: " Sanjay Chitroda via B4 Relay
2026-07-02 17:26 ` Jonathan Cameron
2026-07-02 16:18 ` [PATCH v2 6/6] iio: temperature: hid-sensor-temperature: " Sanjay Chitroda via B4 Relay
2026-07-02 17:29 ` Jonathan Cameron
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=20260705232903.4a58c82b@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=devnull+sanjayembeddedse.gmail.com@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jikos@kernel.org \
--cc=joshua.crofts1@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m32285159@gmail.com \
--cc=nuno.sa@analog.com \
--cc=sanjayembeddedse@gmail.com \
--cc=srinivas.pandruvada@linux.intel.com \
/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