Skip to contentSkip to conversation

media: atomisp: Remove redundant return statements

PATCH In review Avishek Chaulagain 2 participants 2 messages Oct 30 – Oct 31

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: atomisp: Remove redundant return statements

A return statement at the end of a void function is redundant; control returns to the caller once the closing brace is reached. Remove the two such 'return;' statements in hmm_bo_release() and hmm_bo_vunmap(), as reported by checkpatch.pl.

---
 drivers/staging/media/atomisp/pci/hmm/hmm_bo.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/atomisp/pci/hmm/hmm_bo.c +0 -2
index 0a8f401a1..4ceb8cb41 100644
@@ -483,7 +483,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)
@@ -957,7 +956,6 @@ void hmm_bo_vunmap(struct hmm_buffer_object *bo)
 	}
 
 	mutex_unlock(&bo->mutex);
-	return;
 }
 
 void hmm_bo_ref(struct hmm_buffer_object *bo)
Signature · 1 line
2.43.0
#1 lore raw
Quoted 4 lines · Avishek Chaulagain

A return statement at the end of a void function is redundant; control returns to the caller once the closing brace is reached. Remove the two such 'return;' statements in hmm_bo_release() and hmm_bo_vunmap(), as reported by checkpatch.pl.

Usually we expect deeper cleanups for this driver, see [1] for the best (so far) example how somebody can help with it without having deep knowledge on the particular hardware.

This type of change has been appeared many times in the mailing list, you can study the case why it's still not in the upstream.

[1]: https://lore.kernel.org/linux-media/[email protected]/

Signature · 2 lines
With Best Regards,
Andy Shevchenko