All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Harsha Sharma <harshasharmaiitr@gmail.com>
Cc: netfilter-devel@vger.kernel.org, outreachy-kernel@googlegroups.com
Subject: Re: [PATCH] src: Merge assignment with return
Date: Mon, 9 Oct 2017 15:21:54 +0200	[thread overview]
Message-ID: <20171009132154.GA8460@salvia> (raw)
In-Reply-To: <20171006223033.664-1-harshasharmaiitr@gmail.com>

Hi Harsha,

On Sat, Oct 07, 2017 at 04:00:33AM +0530, Harsha Sharma wrote:
> Merge assignment with return statement to directly return the value.
> Done using following coccinelle semantic patch
> 
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -ret =
> +return
>      e;
> -return ret;
> 
> Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> ---
>  src/mini-gmp.c  | 3 +--
>  src/statement.c | 5 +----
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mini-gmp.c b/src/mini-gmp.c
> index acbe1be..0579c46 100644
> --- a/src/mini-gmp.c
> +++ b/src/mini-gmp.c
> @@ -1297,8 +1297,7 @@ mpn_set_str_bits (mp_ptr rp, const unsigned char *sp, size_t sn,
>  	    }
>  	}
>      }
> -  rn = mpn_normalized_size (rp, rn);
> -  return rn;
> +  return mpn_normalized_size(rp, rn);

mini-gmp.c has been extracted from libgmp sources [1], so either you
submit this chunk to them, or you leave this part as is. I would like
we just cache a copy of the mini-gmp.c original file.

Probably you can just check if latest stable release of libgmp
contains updates for mini-gmp.{c,h} and send us a patch to get in sync
with them.

Thanks.

[1] https://gmplib.org/repo/gmp/file/tip/mini-gmp

      reply	other threads:[~2017-10-09 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 22:30 [PATCH] src: Merge assignment with return Harsha Sharma
2017-10-09 13:21 ` Pablo Neira Ayuso [this message]

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=20171009132154.GA8460@salvia \
    --to=pablo@netfilter.org \
    --cc=harshasharmaiitr@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --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.