Re: [PATCH v2 3/6] iio: hid-sensors: Use implicit NULL pointer checks

From: Joshua Crofts

Date: Sun Jul 05 2026 - 15:32:26 EST


On Sun, 5 Jul 2026 at 20:17, Sanjay Chitroda <sanjayembeddedse@xxxxxxxxx> wrote:
>
>
>
> On 2 July 2026 10:52:05 pm IST, Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> >On Thu, 02 Jul 2026 21:48:00 +0530
> >Sanjay Chitroda via B4 Relay <devnull+sanjayembeddedse.gmail.com@xxxxxxxxxx> wrote:
> >
> >> From: Sanjay Chitroda <sanjayembeddedse@xxxxxxxxx>
> >>
> >> 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.

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.

--
Kind regards

CJD