X-GM-THRID: 6340866735627829248 X-Received: by 10.157.56.100 with SMTP id r33mr1327472otd.19.1476349067114; Thu, 13 Oct 2016 01:57:47 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.107.130.39 with SMTP id e39ls947591iod.11.gmail; Thu, 13 Oct 2016 01:57:44 -0700 (PDT) X-Received: by 10.66.13.134 with SMTP id h6mr1218904pac.119.1476349064900; Thu, 13 Oct 2016 01:57:44 -0700 (PDT) Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr. [192.134.164.83]) by gmr-mx.google.com with ESMTPS id p131si1992621vkf.1.2016.10.13.01.57.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 01:57:44 -0700 (PDT) Received-SPF: neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) client-ip=192.134.164.83; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr X-IronPort-AV: E=Sophos;i="5.31,339,1473112800"; d="scan'208";a="240597516" Received: from lstlambert-656-1-236-67.w82-127.abo.wanadoo.fr (HELO hadrien.local) ([82.127.3.67]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Oct 2016 10:57:43 +0200 Date: Thu, 13 Oct 2016 10:57:41 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Greg Kroah-Hartman cc: Mihaela Muraru , outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] Re: [PATCH] Staging: rtl8188eu: hal: Compress return logic into one line In-Reply-To: <20161013085349.GA5232@kroah.com> Message-ID: References: <20161013084120.GA6373@domino-MS-16Y1> <20161013085349.GA5232@kroah.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 13 Oct 2016, Greg Kroah-Hartman wrote: > On Thu, Oct 13, 2016 at 11:41:20AM +0300, Mihaela Muraru wrote: > > Simplify function returns by merging assignment and return into > > one command line. > > Found with Coccinelle > > @@ > > expression e, ret; > > @@ > > > > -ret = > > +return > > e; > > -return ret; > > > > Signed-off-by: Mihaela Muraru > > --- > > ret.out | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > > create mode 100644 ret.out > > > > diff --git a/ret.out b/ret.out > > new file mode 100644 > > index 0000000..fd4d380 > > --- /dev/null > > +++ b/ret.out > > @@ -0,0 +1,22 @@ > > +--- /home/domino/git/kernels/staging/drivers/staging/rtl8188eu/hal/phy.c > > ++++ /tmp/cocci-output-5790-5d9d37-phy.c > > +@@ -44,8 +44,7 @@ u32 phy_query_bb_reg(struct adapter *ada > > + > > + original_value = usb_read32(adapt, regaddr); > > + bit_shift = cal_bit_shift(bitmask); > > +- return_value = (original_value & bitmask) >> bit_shift; > > +- return return_value; > > ++ return (original_value & bitmask) >> bit_shift; > > + } > > + > > + void phy_set_bb_reg(struct adapter *adapt, u32 regaddr, u32 bitmask, u32 data) > > +@@ -123,8 +122,7 @@ u32 rtw_hal_read_rfreg(struct adapter *a > > + > > + original_value = rf_serial_read(adapt, rf_path, reg_addr); > > + bit_shift = cal_bit_shift(bit_mask); > > +- readback_value = (original_value & bit_mask) >> bit_shift; > > +- return readback_value; > > ++ return (original_value & bit_mask) >> bit_shift; > > + } > > + > > + void phy_set_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path, > > Your patch just adds a patch to the tree, not what I think you ment to > send here :) > > Care to try it again? You should apply the patch generated by Coccinelle, using patch -p1 < ret.out julia