From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02EEC34F492 for ; Sun, 5 Jul 2026 18:17:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783275464; cv=none; b=bf6OdZWsjG4g6UmjFYL5+/xWn8xoblDoOAv6HIiYgAeA7P3rtuXMfjCWB7IiH+U8Ss+aiYveSx3JdftQkRq/UsFDFNnFUvW2GnJkh/A0UfP/6C5cbMmcpvBT2M0Peic2b/0SgH2ZmC9HLpuQp3sevfnc1OsCc9gT0YS8zc3ws7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783275464; c=relaxed/simple; bh=dhI2NSSkHQdnuRHh+TevsjJW+xFqrlGDV2/7Z5uiHks=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=SbhdiCJQ0kB7ZbcEGyZLUpxdXuaAbfZm45FVIGQ+BXzT3hlge8Zqj6vBMbJWogPu/tXYWZCnH+SowlMMmCYpS2UrFQlm+oflrn2IgHmyKisDBB9s//PoUfUw3SWwVlCSlqSRFsoZ2iTLSAboorbpdtc4k/zVKHSBi4PYNixVP3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Mc+oq6rW; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mc+oq6rW" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-382ef647e20so1187689a91.1 for ; Sun, 05 Jul 2026 11:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783275461; x=1783880261; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=HPuWUz6K1vjqfLd89Qgt+4X64jH/WQepHZOhzBXpFBs=; b=Mc+oq6rWGUenBzFtmvEUJ+cxwDxZAPvves1/eocNtmNJscDuk6o+nMPF1eH0MGyFrP RXkGYbcK7Sc7L4CG0Eu6X93ORKKDklom+QRE4tn2WikivT5U9YDZHMBYxhRUHuPXiTwU FdYYaWZ+MKa0z0k+E4WUef9HKZb4TCu/908sXgnr615cW/7DFjFuTZtr271IfgmKcxA5 lMqEIw1UsE1KWG8cQXYjIIhvVDNa45Ly90bk+A51VlkYJvKNIpQDyywNDpX27zVgR59q NTof52fYfmVD+1JZaDWX62fEjFLZyQZ8q51gw06AksHKVJDhWQvkAKfJoU3UUnl8elgC He5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783275461; x=1783880261; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HPuWUz6K1vjqfLd89Qgt+4X64jH/WQepHZOhzBXpFBs=; b=MN4Cee+UiHaQDxeUhGuy8Bj7z9yEeOOSV7NpxKvjyO/afn6G3/4k3vkbmqfcIshyPP cipAzakntJI/yBjqESu7wE+nw2u5veM7Q2BIt0zMfScFeu+atmR9iPas005z7W/v/j6F sOHOiYS/IapF8fUs+Fue73G5+QKa4H26LxfTqUGAnK+94yl8eeqcXknqTzZq8RUV16px zsIi5nfP7Qav9DaR70Yy8sjGHpBpRh6dW50slVFQ0LlHUmY591mkmDg/jZJk/YGvx+0h P44+/iwlf10fnYCf30ryiljg0/2qiRs8nJ3OmSmsGU5sEDphnfWbT37MDvVM93nJjuT2 OU9Q== X-Forwarded-Encrypted: i=1; AHgh+RrAdqFBNzH3f8a9A8+OLp4WMlUutFEO5tC2oTSZNvY3kO2N4YHZF3ycOvauTNGKFCD2oqV6Q1oYKmxqG0A=@vger.kernel.org X-Gm-Message-State: AOJu0YznFmjDLmkJWnClsgAGoeCaF/jH48jxuylzkvn8yJCzySaWEC4W RpMK5Xr/HRR96sGXxBI95UKOi/3VP6znCKX6aqsfzeem4QyhH8x4sETR4YRJ6A== X-Gm-Gg: AfdE7ckUVSwyyBzxcH96WgAPiMCTanIR/wOYMYxIZtV4htNO68dI8moYYIDsYW5DG/i 5ZVuFbFUFLEbYElBglY17fSUL43Mw+9lHF4SWIclO6ihDilH9GimtZa3dS3aBs5zTOYeooKTcuO gGDXn8Usop0b/t6S9jItUbk20mDIG2rl8gKw703i9p8RQSyTkm9Rf94nfmTPFCB0/h+xswGMqyS 6gGmUJYrHwGlGikJtBuV6wznlYvsqRQcAQJJqio7X2LKfaxaCuP9FOmdqssbaLxygi9iKn7HVUQ 4BE/3cilshur53ACKY/woe9VKdq36p1b8MjXGqJXAQIlXofv/fGZHSJQFG1+h2TG9YCj8eiCF9v 6qbsWfBFrDOhLGzQSVa8Oaxi73HKkZ04yBLmKdzJH5v8iaSDTv1tNux6LcQffcoCdwgygLmzszw Td8F6dYIoCllMoEA/bg7+e//UDmP5Nvgp6TOdW X-Received: by 2002:a17:90b:268f:b0:381:1c96:829b with SMTP id 98e67ed59e1d1-382803bb30emr7701477a91.3.1783275461234; Sun, 05 Jul 2026 11:17:41 -0700 (PDT) Received: from ehlo.thunderbird.net ([2401:4900:1f3f:c3f5:258d:4c0a:f0e6:bd1a]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30f116065c5sm41239387eec.11.2026.07.05.11.17.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Jul 2026 11:17:40 -0700 (PDT) Date: Sun, 05 Jul 2026 23:47:36 +0530 From: Sanjay Chitroda To: Jonathan Cameron , Sanjay Chitroda via B4 Relay CC: David Lechner , =?ISO-8859-1?Q?Nuno_S=E1?= , Andy Shevchenko , Jiri Kosina , Srinivas Pandruvada , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Maxwell Doose Subject: Re: [PATCH v2 3/6] iio: hid-sensors: Use implicit NULL pointer checks User-Agent: Thunderbird for Android In-Reply-To: <20260702182205.388efe24@jic23-huawei> References: <20260702-15-jun-hid-iio-alignment-v2-0-b87f01f5efbc@gmail.com> <20260702-15-jun-hid-iio-alignment-v2-3-b87f01f5efbc@gmail.com> <20260702182205.388efe24@jic23-huawei> Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2 July 2026 10:52:05=E2=80=AFpm IST, Jonathan Cameron wrote: >On Thu, 02 Jul 2026 21:48:00 +0530 >Sanjay Chitroda via B4 Relay wrote: > >> From: Sanjay Chitroda >>=20 >> Replace explicit NULL pointer comparisons with implicit checks across >> HID sensor IIO drivers to follow the preferred kernel coding style=2E >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=2E There is no kernel coding guideline for NULL pointer=2E If you think it wo= uld be useful, I would be happy to work on documenting the preferred conven= tions under "Documentation/driver-api/iio/", for example as a new "coding-s= tyle=2Erst" or similar document=2E Thanks, Sanjay >>=20 >> Convert 'if (indio_dev =3D=3D NULL)' -> 'if (!indio_dev)'=2E >>=20 >> No functional change=2E >>=20 >> Signed-off-by: Sanjay Chitroda >> Reviewed-by: Maxwell Doose >> --- >> drivers/iio/accel/hid-sensor-accel-3d=2Ec | 2 +- >> drivers/iio/magnetometer/hid-sensor-magn-3d=2Ec | 2 +- >> drivers/iio/orientation/hid-sensor-incl-3d=2Ec | 2 +- >> drivers/iio/orientation/hid-sensor-rotation=2Ec | 2 +- >> 4 files changed, 4 insertions(+), 4 deletions(-) >>=20 >> diff --git a/drivers/iio/accel/hid-sensor-accel-3d=2Ec b/drivers/iio/ac= cel/hid-sensor-accel-3d=2Ec >> index 9197f3424c0c=2E=2E225f8dd65ab1 100644 >> --- a/drivers/iio/accel/hid-sensor-accel-3d=2Ec >> +++ b/drivers/iio/accel/hid-sensor-accel-3d=2Ec >> @@ -325,7 +325,7 @@ static int hid_accel_3d_probe(struct platform_devic= e *pdev) >> =20 >> indio_dev =3D devm_iio_device_alloc(&pdev->dev, >> sizeof(struct accel_3d_state)); >> - if (indio_dev =3D=3D NULL) >> + if (!indio_dev) >> return -ENOMEM; >> =20 >> platform_set_drvdata(pdev, indio_dev); >> diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d=2Ec b/drivers/= iio/magnetometer/hid-sensor-magn-3d=2Ec >> index ad10fa20fae0=2E=2E738bad65d74d 100644 >> --- a/drivers/iio/magnetometer/hid-sensor-magn-3d=2Ec >> +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d=2Ec >> @@ -463,7 +463,7 @@ static int hid_magn_3d_probe(struct platform_device= *pdev) >> =20 >> indio_dev =3D devm_iio_device_alloc(&pdev->dev, >> sizeof(struct magn_3d_state)); >> - if (indio_dev =3D=3D NULL) >> + if (!indio_dev) >> return -ENOMEM; >> =20 >> platform_set_drvdata(pdev, indio_dev); >> diff --git a/drivers/iio/orientation/hid-sensor-incl-3d=2Ec b/drivers/i= io/orientation/hid-sensor-incl-3d=2Ec >> index 870c8929491e=2E=2Ec8efb0dab8b6 100644 >> --- a/drivers/iio/orientation/hid-sensor-incl-3d=2Ec >> +++ b/drivers/iio/orientation/hid-sensor-incl-3d=2Ec >> @@ -302,7 +302,7 @@ static int hid_incl_3d_probe(struct platform_device= *pdev) >> =20 >> indio_dev =3D devm_iio_device_alloc(&pdev->dev, >> sizeof(struct incl_3d_state)); >> - if (indio_dev =3D=3D NULL) >> + if (!indio_dev) >> return -ENOMEM; >> =20 >> platform_set_drvdata(pdev, indio_dev); >> diff --git a/drivers/iio/orientation/hid-sensor-rotation=2Ec b/drivers/= iio/orientation/hid-sensor-rotation=2Ec >> index 2dad0453fc67=2E=2E6db253c1635d 100644 >> --- a/drivers/iio/orientation/hid-sensor-rotation=2Ec >> +++ b/drivers/iio/orientation/hid-sensor-rotation=2Ec >> @@ -274,7 +274,7 @@ static int hid_dev_rot_probe(struct platform_device= *pdev) >> =20 >> indio_dev =3D devm_iio_device_alloc(&pdev->dev, >> sizeof(struct dev_rot_state)); >> - if (indio_dev =3D=3D NULL) >> + if (!indio_dev) >> return -ENOMEM; >> =20 >> platform_set_drvdata(pdev, indio_dev); >>=20 >