Received: by 10.213.65.68 with SMTP id h4csp760664imn; Wed, 28 Mar 2018 12:11:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx48REXqT12mjKwivZvkiz76B39gEykRvmGwteuVe+S+V7f2leAavsa63dUJR32gEY7FVWRHJ X-Received: by 10.98.87.151 with SMTP id i23mr3908692pfj.175.1522264305820; Wed, 28 Mar 2018 12:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522264305; cv=none; d=google.com; s=arc-20160816; b=0U+I+d4I6qxK9bc3PUgEmpfv1llsXnxh1ZUgjoln9uby24ZidFpnNinMPM0gUl8bFQ VveovS7xdxSNCoNo4LfCUb/sV/1aZ0x3UpQ+/5lYu2701UxGdC4hJLnTff7fOg8cCI1r x4bArYNRk0ODakzZWW+C6DRXNCNPG7pDo+ukMjm0EiGOmepYdHzxGMeycpWPvd3RPpFW HZ5Gtm46PKTQ/ChLWsYt0R2a7+TaL/0YRk9V8DAABcfjjK9YW5u9c4AdLDChO0hv+00r 8GPS50CLsHzACaN7Likgwvgs9YN7F7G9Gzo1ltudJyh1DezVJy2NkhWoXMm2KrA2zQYf T7ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=aHD3PfvJXOfeSAhofrvTdBjPzvzwlA7MxUo0KMdRzao=; b=eIkUWWAOOmsblaWNKoKC5ir5oZrYnvXYMMMM0fWAp6PGRlZ7SBlu6gUngeDhrxI4c9 WIu4M04i2ymli9nkFmYCJAi6JQ/VDv7YRWvTPqbgGEtedamzZxxASVvGT+eCbYUsFLD7 a+P1D5VEwqj0WmLIrEWX/LCkE3VBjojVkGxHujqt/mPtftSgQVThXN+THb0CJDmejOQS siN23zUCqJKk3WobBzcC4WSjYHDHyvqhyBxt4oAK7OumRp8m9wEUfvgj5e8X26xQF7t3 X6S3X1SmkF8UZ2rwN0j5utBwNqlHJllnmXz1lFq0RlviQCWlA67UvFIYglpD22h+nK+p 1xIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kVio7JQY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8-v6si4046298ple.556.2018.03.28.12.11.31; Wed, 28 Mar 2018 12:11:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kVio7JQY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753977AbeC1TKA (ORCPT + 99 others); Wed, 28 Mar 2018 15:10:00 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:41218 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297AbeC1TJ4 (ORCPT ); Wed, 28 Mar 2018 15:09:56 -0400 Received: by mail-pg0-f66.google.com with SMTP id t10so1382032pgv.8; Wed, 28 Mar 2018 12:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=aHD3PfvJXOfeSAhofrvTdBjPzvzwlA7MxUo0KMdRzao=; b=kVio7JQY3ZHhl1r+o3IlGxI9aIbvB8ZGVti8sc5ibYTRcuvdS4y1108JLbhcOnq2ya cR05fnLe6edcn0gkEzLlchkVrapRym6VS/hzQJ6ytfB+Aq0M7BuBemM28lO6h6lTTug5 uJzKbzKmuoiaqeKxhs1NaToSuFFDeQeh2DqYJyMtpKD4LPavDMPNjLi35W4EkBKevqUt wme69KPBkNPcL9A4GtNoY1qzrbmTPQ1o/w4VZBZg4U0Oo02vu1TsMPXFSN/MfGmk/Em6 n0ufDQ8cNdARxf8HsOZYd2inFjd4CLvo1JOk1w/9CcwdlDfEeBv21rOTDh88v9ESgzSC hKag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=aHD3PfvJXOfeSAhofrvTdBjPzvzwlA7MxUo0KMdRzao=; b=E797LNwkrXJVRgh9XLCASmAC6uCXeErJYKdWee4Pcjc4Zt0nwQX+xPb241Ke2rzWeM Qp8O5CiijZxf03R3mkLaBWipdmT4mlZcE9yOO6nF1pfBaX9dPEhgfawBT0Uf2YQ3PH5f h2htADljxbZmx4Xj/DN7xV6bfT5NzybkbYMJhiQQbfi41EgCuzUarFLj2VVPw7hexw1N xigA05Syrx5en4Ba4UstW5+z1J3P3dinrwd0vEXPoP3ZWnZEXUvJre9Fx8ethg4qjo2x Df88gFcSuhncguPKJ+JuFMqafdwI2TEifB0lwZnAFcRNEZfC4K48O83nQIlobBfb4lSw KWGw== X-Gm-Message-State: AElRT7H4Sik2MczYlnILglLHOLQvgIGOYY0xo6C6vJJ/hRfg0PLqF65i 0aeRG3RIBWiRHjNK5pv0MPnbkw== X-Received: by 2002:a17:902:6984:: with SMTP id l4-v6mr5145950plk.61.1522264195748; Wed, 28 Mar 2018 12:09:55 -0700 (PDT) Received: from seema-Inspiron-15-3567 ([14.139.82.6]) by smtp.gmail.com with ESMTPSA id f5sm8555307pgn.56.2018.03.28.12.09.54 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Mar 2018 12:09:54 -0700 (PDT) Date: Thu, 29 Mar 2018 00:39:50 +0530 From: Arushi Singhal To: pablo@netfilter.org Cc: outreachy-kernel , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: netfilter: Merge assignment with return Message-ID: <20180328190950.GA3151@seema-Inspiron-15-3567> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Merge assignment with return statement to directly return the value. Signed-off-by: Arushi Singhal --- net/netfilter/nf_conntrack_netlink.c | 5 ++--- net/netfilter/xt_hashlimit.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index dd177eb..bfa8b7f 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -1497,9 +1497,8 @@ ctnetlink_setup_nat(struct nf_conn *ct, const struct nlattr * const cda[]) if (ret < 0) return ret; - ret = ctnetlink_parse_nat_setup(ct, NF_NAT_MANIP_SRC, - cda[CTA_NAT_SRC]); - return ret; + return ctnetlink_parse_nat_setup(ct, NF_NAT_MANIP_SRC, + cda[CTA_NAT_SRC]); #else if (!cda[CTA_NAT_DST] && !cda[CTA_NAT_SRC]) return 0; diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 66f5aca..9e8ba2e 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -534,8 +534,7 @@ static u64 user2rate_bytes(u32 user) u64 r; r = user ? U32_MAX / user : U32_MAX; - r = (r - 1) << XT_HASHLIMIT_BYTE_SHIFT; - return r; + return (r - 1) << XT_HASHLIMIT_BYTE_SHIFT; } static void rateinfo_recalc(struct dsthash_ent *dh, unsigned long now, -- 2.7.4