[4/4] Remove redundant return value check

Message ID 20231102141135.369-4-adiupina@astralinux.ru
State New
Headers
Series [1/4] Remove redundant return value check |

Commit Message

Alexandra Diupina Nov. 2, 2023, 2:11 p.m. UTC
  media_entity_pads_init() will not return 0 only if the
2nd parameter >= MEDIA_ENTITY_MAX_PADS (512), but 1 is
passed, so checking the return value is redundant

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 2ec5bfe0c24a ("media: atomisp: gc0310: Switch over to ACPI powermanagement")
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
---
 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Patch

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
index 9a11793f34f7..62550504b68c 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
@@ -660,11 +660,7 @@  static int gc0310_probe(struct i2c_client *client)
 		return ret;
 	}
 
-	ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
-	if (ret) {
-		gc0310_remove(client);
-		return ret;
-	}
+	media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
 
 	ret = v4l2_async_register_subdev_sensor(&dev->sd);
 	if (ret) {