Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbdILO2v (ORCPT ); Tue, 12 Sep 2017 10:28:51 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:14475 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbdILO2r (ORCPT ); Tue, 12 Sep 2017 10:28:47 -0400 X-IronPort-AV: E=Sophos;i="5.42,383,1500933600"; d="scan'208";a="290704469" Date: Tue, 12 Sep 2017 16:27:55 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Srishti Sharma cc: mchehab@kernel.org, gregkh@linuxfoundation.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH] Staging: media: atomisp: Merge assignment with return In-Reply-To: <1505226307-5119-1-git-send-email-srishtishar@gmail.com> Message-ID: References: <1505226307-5119-1-git-send-email-srishtishar@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1668 Lines: 55 On Tue, 12 Sep 2017, 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 Acked-by: Julia Lawall > --- > 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 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505226307-5119-1-git-send-email-srishtishar%40gmail.com. > For more options, visit https://groups.google.com/d/optout. >