From patchwork Sat Mar 20 06:15:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Kalyaan Palla X-Patchwork-Id: 12152389 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21140C433E0 for ; Sat, 20 Mar 2021 11:15:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E888A619A3 for ; Sat, 20 Mar 2021 11:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231161AbhCTLOk (ORCPT ); Sat, 20 Mar 2021 07:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231284AbhCTLOc (ORCPT ); Sat, 20 Mar 2021 07:14:32 -0400 Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F531C0611BF; Sat, 20 Mar 2021 03:54:55 -0700 (PDT) Received: by mail-vs1-xe2c.google.com with SMTP id k14so4900745vsb.6; Sat, 20 Mar 2021 03:54:55 -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; bh=oHahWSVlLUNFk2dULEm5PnUk4cpGh3Men11lJT8PaXg=; b=KyzxLak81HiQiatX3GX1rM4RJZGmN6niH0mC+dsow3kkbIuJkbKHaSHiTViUd+i1ld Y9R4xTigpf3VOOOs7VzB5o3NVyT8lLuhJ1FoQt7OjwVJF+luUk4JSpejmh4YNTDskmwg 5KKDbdBH/nJKBcLrVGWZ+8Wv48Gcs0j/xx40AFhHh7fyTJHsV9HWqHHvsC02TNALQADy K4jlA//uZat3zgHqA1FWkVU9hBQQVDNgyfuMAwYSrk5ZgN/LZ1Ue+99FvNWzQo8M2e9s x2D+Qlu+R7ZcSH5n/bMsspwVa6Zxv+1G1ASo6CyLwjyOszAYrcxa/aWC4acXe66Dm9uG jnLQ== 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; bh=oHahWSVlLUNFk2dULEm5PnUk4cpGh3Men11lJT8PaXg=; b=uJk6WaslnNmCUU0IsyiPXFjcBCKpFEZjkHw5hsuRgEfUdrBpRBKhGYecVPRecjRJV2 Vh7C9ZXJOfVOHTmOSii30ZS2SL8ING4EDEN0dhSp5XYWLzj/Zip1UI3xth6KzA/CX3qt 9HL9DFm+JsapU8J6CuHN3ILJeHTRwfnvWoZG7eOdV3Tm8znlSMchY7ceUwvKBIDNj3w9 LqsUjgRK15QkGWNIvO0zC6wIrfxpxdAVFCaYkfKJA24su+j8SJEuG/9W15etZkWmV1qj D2b4fS6GXypxlJntvgURjgqz5wd6XzEQOvIrd4xNRKcqL7TvX/fABSX5rC/KXrWQgOCl Gzpw== X-Gm-Message-State: AOAM532K/rqZJsn1+9K2yzYZWMNsIW53Dou+Lm47EAbsm14Q2mj4ZMfD V6hq7sQO47/RszeFqpQp6xFr5b1b1zfyBIIA X-Google-Smtp-Source: ABdhPJwj37GXsy65AMroGZ7FNWUh7O5tDzbVjzwXsBrHaJOoLZCPVBapA5vjLi2yfpMhJOSV1sKQ9g== X-Received: by 2002:a17:902:441:b029:e6:364a:5f55 with SMTP id 59-20020a1709020441b02900e6364a5f55mr17635745ple.7.1616220920082; Fri, 19 Mar 2021 23:15:20 -0700 (PDT) Received: from localhost ([61.12.83.162]) by smtp.gmail.com with ESMTPSA id z1sm7174823pfn.127.2021.03.19.23.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 23:15:19 -0700 (PDT) Date: Sat, 20 Mar 2021 11:45:12 +0530 From: Sai Kalyaan Palla To: "David S. Miller" , Jakub Kicinski , Sai Kalyaan Palla , Gaurav Singh , Vadim Fedorenko , Andrew Lunn , David Laight , linux-decnet-user@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bkkarthik@pesu.pes.edu Subject: [PATCH] net: decnet: Fixed multiple coding style issues Message-ID: <20210320061512.kztp7hijps4irjrl@ubuntu> MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Made changes to coding style as suggested by checkpatch.pl changes are of the type: open brace '{' following struct go on the same line do not use assignment in if condition Signed-off-by: Sai Kalyaan Palla --- net/decnet/dn_route.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 2193ae529e75..940755cdecc9 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c @@ -84,8 +84,7 @@ #include #include -struct dn_rt_hash_bucket -{ +struct dn_rt_hash_bucket { struct dn_route __rcu *chain; spinlock_t lock; }; @@ -359,7 +358,8 @@ static void dn_run_flush(struct timer_list *unused) for (i = 0; i < dn_rt_hash_mask; i++) { spin_lock_bh(&dn_rt_hash_table[i].lock); - if ((rt = xchg((struct dn_route **)&dn_rt_hash_table[i].chain, NULL)) == NULL) + rt = xchg((struct dn_route **)&dn_rt_hash_table[i].chain, NULL); + if (!rt) goto nothing_to_declare; for(; rt; rt = next) { @@ -425,7 +425,8 @@ static int dn_return_short(struct sk_buff *skb) /* Add back headers */ skb_push(skb, skb->data - skb_network_header(skb)); - if ((skb = skb_unshare(skb, GFP_ATOMIC)) == NULL) + skb = skb_unshare(skb, GFP_ATOMIC); + if (!skb) return NET_RX_DROP; cb = DN_SKB_CB(skb); @@ -461,7 +462,8 @@ static int dn_return_long(struct sk_buff *skb) /* Add back all headers */ skb_push(skb, skb->data - skb_network_header(skb)); - if ((skb = skb_unshare(skb, GFP_ATOMIC)) == NULL) + skb = skb_unshare(skb, GFP_ATOMIC); + if (!skb) return NET_RX_DROP; cb = DN_SKB_CB(skb); @@ -505,7 +507,8 @@ static int dn_route_rx_packet(struct net *net, struct sock *sk, struct sk_buff * struct dn_skb_cb *cb; int err; - if ((err = dn_route_input(skb)) == 0) + err = dn_route_input(skb); + if (err == 0) return dst_input(skb); cb = DN_SKB_CB(skb); @@ -629,7 +632,8 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type if (dn == NULL) goto dump_it; - if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) + skb = skb_share_check(skb, GFP_ATOMIC); + if (!skb) goto out; if (!pskb_may_pull(skb, 3)) @@ -1324,7 +1328,8 @@ static int dn_route_input_slow(struct sk_buff *skb) dev_hold(in_dev); - if ((dn_db = rcu_dereference(in_dev->dn_ptr)) == NULL) + dn_db = rcu_dereference(in_dev->dn_ptr); + if (!dn_db) goto out; /* Zero source addresses are not allowed */