Re: [PATCH v4] media: staging: atomisp: Remove unnecessary return statements from void functions

From: Dan Carpenter

Date: Wed Mar 11 2026 - 06:12:27 EST


On Wed, Mar 11, 2026 at 10:48:07AM +0100, Tomasz Unger wrote:
> diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c
> index 40b3f1e48c56..db4052ab3665 100644
> --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c
> +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c
> @@ -6,7 +6,6 @@
>
> #include "system_global.h"
>
> -

I was debating whether I should ignore this... When you delete a return
and a blank line those have to be done as one step otherwise you're
introducing new checkpatch warnings. But this blank line is an
unrelated change. The patch does it a couple other places as well.

> #include "input_formatter.h"
> #include <type_support.h>
> #include "gp_device.h"
> @@ -65,8 +64,6 @@ void input_formatter_rst(
> if (!HIVE_IF_BIN_COPY[ID]) {
> input_formatter_reg_store(ID, addr, rst);
> }
> -
> - return;
> }
>

[ snip ]

> @@ -483,7 +482,6 @@ void hmm_bo_release(struct hmm_buffer_object *bo)
> __bo_insert_to_free_rbtree(&bdev->free_rbtree, bo);
>
> mutex_unlock(&bdev->rbtree_mutex);
> - return;
> }
>
> void hmm_bo_device_exit(struct hmm_bo_device *bdev)
> @@ -737,8 +735,6 @@ void hmm_bo_free_pages(struct hmm_buffer_object *bo)
> kfree(bo->pages);
> mutex_unlock(&bo->mutex);
>
> - return;
> -

Deleting this return introduces a bug.

> status_err2:
> mutex_unlock(&bo->mutex);
> dev_err(atomisp_dev,
> @@ -868,8 +864,6 @@ void hmm_bo_unbind(struct hmm_buffer_object *bo)
>
> mutex_unlock(&bo->mutex);
>
> - return;
> -

Bug.

> status_err:
> mutex_unlock(&bo->mutex);
> dev_err(atomisp_dev,

regards,
dan carpenter