From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Mihaela Muraru <mihaela.muraru21@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [PATCH] Staging: rtl8188eu: hal: Compress return logic into one line
Date: Thu, 13 Oct 2016 10:53:49 +0200 [thread overview]
Message-ID: <20161013085349.GA5232@kroah.com> (raw)
In-Reply-To: <20161013084120.GA6373@domino-MS-16Y1>
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 <mihaela.muraru21@gmail.com>
> ---
> 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?
thanks,
greg k-h
next prev parent reply other threads:[~2016-10-13 8:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 8:41 [PATCH] Staging: rtl8188eu: hal: Compress return logic into one line Mihaela Muraru
2016-10-13 8:42 ` [Outreachy kernel] " Julia Lawall
2016-10-13 8:53 ` Greg Kroah-Hartman [this message]
2016-10-13 8:57 ` [Outreachy kernel] " Julia Lawall
2016-10-13 9:15 ` Muraru Mihaela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161013085349.GA5232@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=mihaela.muraru21@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.