Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730886 > unrolled thread

[PATCH] Staging: media: atomisp: Merge assignment with return

Started bySrishti Sharma <srishtishar@gmail.com>
First post2017-09-12 16:30 +0200
Last post2017-09-18 13:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Staging: media: atomisp: Merge assignment with return Srishti Sharma <srishtishar@gmail.com> - 2017-09-12 16:30 +0200
    Re: [PATCH] Staging: media: atomisp: Merge assignment with return Sakari Ailus <sakari.ailus@iki.fi> - 2017-09-18 13:50 +0200

#1730886 — [PATCH] Staging: media: atomisp: Merge assignment with return

FromSrishti Sharma <srishtishar@gmail.com>
Date2017-09-12 16:30 +0200
Subject[PATCH] Staging: media: atomisp: Merge assignment with return
Message-ID<uoUmm-2nc-15@gated-at.bofh.it>
Merge the assignment and the return statements to return the value
directly. Done using the following semantic patch by coccinelle.

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
index 11162f5..e6ddfbf 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
@@ -1168,13 +1168,9 @@ void hmm_bo_free_pages(struct hmm_buffer_object *bo)
 
 int hmm_bo_page_allocated(struct hmm_buffer_object *bo)
 {
-	int ret;
-
 	check_bo_null_return(bo, 0);
 
-	ret = bo->status & HMM_BO_PAGE_ALLOCED;
-
-	return ret;
+	return bo->status & HMM_BO_PAGE_ALLOCED;
 }
 
 /*
-- 
2.7.4

[toc] | [next] | [standalone]


#1734070

FromSakari Ailus <sakari.ailus@iki.fi>
Date2017-09-18 13:50 +0200
Message-ID<ur2IO-5LK-11@gated-at.bofh.it>
In reply to#1730886
On Tue, Sep 12, 2017 at 07:55:07PM +0530, Srishti Sharma wrote:
> Merge the assignment and the return statements to return the value
> directly. Done using the following semantic patch by coccinelle.
> 
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -ret =
> +return
>      e;
> -return ret;
> 
> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>

Hi Srishti,

I've merged the two patches as they're trivial and the commit message is
the same.

It's entirely reasonable to have a patch per driver but you should mention
that in the commit message (subject line) at least. This case is a bit
special because the other driver is also specific to the atomisp staging
driver.

Thanks.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web