iio: hid-sensors: Use implicit NULL pointer checks

Replace explicit NULL pointer comparisons with implicit checks across
HID sensor IIO drivers to fix kernel coding style.

CHECK: Comparison to NULL could be written ...

No functional change.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Reviewed-by: Maxwell Doose <m32285159@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Sanjay Chitroda
2026-07-07 00:29:44 +05:30
committed by Jonathan Cameron
parent 636deb551c
commit 2e2f2de753
5 changed files with 6 additions and 6 deletions

View File

@@ -324,7 +324,7 @@ static int hid_accel_3d_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(&pdev->dev,
sizeof(struct accel_3d_state));
if (indio_dev == NULL)
if (!indio_dev)
return -ENOMEM;
platform_set_drvdata(pdev, indio_dev);

View File

@@ -266,7 +266,7 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
trig = iio_trigger_alloc(indio_dev->dev.parent,
"%s-dev%d", name, iio_device_id(indio_dev));
if (trig == NULL) {
if (!trig) {
dev_err(&indio_dev->dev, "Trigger Allocate Failed\n");
return -ENOMEM;
}

View File

@@ -321,7 +321,7 @@ static int magn_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
iio_val = magn_state->magn_val_addr[offset];
if (iio_val != NULL)
if (iio_val)
*iio_val = *((u32 *)raw_data);
else
ret = -EINVAL;
@@ -460,7 +460,7 @@ static int hid_magn_3d_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(&pdev->dev,
sizeof(struct magn_3d_state));
if (indio_dev == NULL)
if (!indio_dev)
return -ENOMEM;
platform_set_drvdata(pdev, indio_dev);

View File

@@ -301,7 +301,7 @@ static int hid_incl_3d_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(&pdev->dev,
sizeof(struct incl_3d_state));
if (indio_dev == NULL)
if (!indio_dev)
return -ENOMEM;
platform_set_drvdata(pdev, indio_dev);

View File

@@ -273,7 +273,7 @@ static int hid_dev_rot_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(&pdev->dev,
sizeof(struct dev_rot_state));
if (indio_dev == NULL)
if (!indio_dev)
return -ENOMEM;
platform_set_drvdata(pdev, indio_dev);