On Sun, 5 Jul 2026 at 20:17, Sanjay Chitroda [off-list ref] wrote:
On 2 July 2026 10:52:05 pm IST, Jonathan Cameron [off-list ref] wrote:
quoted
On Thu, 02 Jul 2026 21:48:00 +0530
Sanjay Chitroda via B4 Relay [off-list ref] wrote:
quoted
From: Sanjay Chitroda <redacted>
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