From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753306AbcG2VOf (ORCPT ); Fri, 29 Jul 2016 17:14:35 -0400 Received: from smtprelay0250.hostedemail.com ([216.40.44.250]:37909 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751640AbcG2VO1 (ORCPT ); Fri, 29 Jul 2016 17:14:27 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3871:3872:3873:4321:5007:7903:10004:10400:10848:11026:11232:11657:11658:11783:11914:12043:12296:12438:12517:12519:12740:13069:13311:13357:13439:13894:14659:14721:21080:21434:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:7,LUA_SUMMARY:none X-HE-Tag: star91_7dd706df18f3f X-Filterd-Recvd-Size: 2102 Message-ID: <1469826863.3998.91.camel@perches.com> Subject: Re: [PATCH 33/33] Staging: android: ion: ion.c: Compression of lines for From: Joe Perches To: Nadim almas , labbott@redhat.com Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Date: Fri, 29 Jul 2016 14:14:23 -0700 In-Reply-To: <1469826406-18142-1-git-send-email-nadim.902@gmail.com> References: <1469826406-18142-1-git-send-email-nadim.902@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2016-07-29 at 14:06 -0700, Nadim almas wrote: > This patch compresses two lines in to a single line in file rtw_android.c > if immediate return statement is found. It also removes variable  > bytes_written as it is no longer needed. > > It is done using script Coccinelle. And coccinelle uses following semantic > patch for this compression function: [] > diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c [] > @@ -391,9 +391,7 @@ static int ion_handle_put_nolock(struct ion_handle *handle) >  { >   int ret; >   > - ret = kref_put(&handle->ref, ion_handle_destroy); > - > - return ret; > +        return kref_put(&handle->ref, ion_handle_destroy); >  } int ret; is now unused. Please make sure you compile the files modified by any script and remove any newly introduced warnings. >  static int ion_handle_put(struct ion_handle *handle) > @@ -597,8 +595,8 @@ int ion_phys(struct ion_client *client, struct ion_handle *handle, >   return -ENODEV; >   } >   mutex_unlock(&client->lock); > - ret = buffer->heap->ops->phys(buffer->heap, buffer, addr, len); > - return ret; > + > +        return buffer->heap->ops->phys(buffer->heap, buffer, addr, len); >  } >  EXPORT_SYMBOL(ion_phys);