Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1081558ybi; Sat, 8 Jun 2019 02:02:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzItmRNieUmmmEr2SrOL5cFhdMzePPrVy1z270qrccQAZ2JJBSqee4mmZ0D8xYiSBNbCXaQ X-Received: by 2002:a17:90a:cb12:: with SMTP id z18mr9793707pjt.82.1559984540751; Sat, 08 Jun 2019 02:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559984540; cv=none; d=google.com; s=arc-20160816; b=z81xt0jGGokphpix8wyFtrEhZMEuMXerW8py8lFsDbVrnky6p0rrmc0oL0R0t82pHD WtzMeGFTdQ1mfKSdbm3PYqDkvj+qsYuROOQNmxL+zF3EEhMQTRx0pS9EnDocZ0NLz2Gw zJp5h1fn8Y3nJhIkbLB54uGrsvyC+KKAKWmltscUBx+DhaEf6xsoMKReElHstoTQo/8N rsInN4XGj5K44mxlMNS5fT2FwG+NKUzT6ZpvJMhUQ7De/yLS4tgRfBBkLt5PL48s82ny t37CQwVKW13dlZmGhJSGl931iKDaeqjHONV9ZtJf9Bw/DFE4vo62vBPjF+mGQHbslEa2 DB6A== 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:to:from:date:dkim-signature; bh=WNvqLoTkh0fWgkbS/w4CTYn2SASEM94dbBgdk4HmiaM=; b=hLugLVtAZb1UWy9gCfhXRKEi24XVXdfNNXFOTHBHnywawprnG1uUxaUO/Y3DQGoZpH tmTXGDgmOsIbXDeVTTdWNB6JTf/tpNNnrTIQc2GiDS501JV2mKOlB+Vphvx45s9B2oCa jqEcYIpi0mhnRAUGWcZlMiDmOBfOlHnK8Kg6sDuULsh8ePZhsfXRJoYhH/I7n4SbMaHo twVoj4ow1HYFSDqyLt4kaT+ubYO0lvBKdRn8u+rguzNDzxcHGWsaqRLEvGY/4Hili8bF ICsJnBoUkGViq3cN8lR0pJ8wwQ4TW0h2+itVg/XDwghlhh4PnIYuFo9gS/TFhv2cnvjH Cg4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="J5Y7/RC7"; 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 x1si4313446pfa.253.2019.06.08.02.02.03; Sat, 08 Jun 2019 02:02:20 -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="J5Y7/RC7"; 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 S1726613AbfFHJA4 (ORCPT + 99 others); Sat, 8 Jun 2019 05:00:56 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45841 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbfFHJAz (ORCPT ); Sat, 8 Jun 2019 05:00:55 -0400 Received: by mail-pl1-f193.google.com with SMTP id bi6so1324016plb.12; Sat, 08 Jun 2019 02:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=WNvqLoTkh0fWgkbS/w4CTYn2SASEM94dbBgdk4HmiaM=; b=J5Y7/RC7yDTLqB33iZOJHnhB+0UVex4VEmrvVxXMv7+x2Jup+1V7oJameXcXPZDndB zttzlKdq4FauXoGSiOSxKWkLm4AmBKxFhhIPiJbzI2tYMMogoIML1ozW8MfPaY4EDo0/ XXnuVbQxs9tBIs6F6hHcOXF2ZXStCIodJCRa7PWVTJ4nKMdJrMaQecwUYu++AabPNBBz Z9Drj4lCJvYbP/R+EQwpbS678Qml6gsWNS/2KRESzdcBCbKOcD1J3CG9vA86i90LrGIG D0SU3mUBJkDgHLnLCrMbwfcbBBpKxvKIyy3ZlzgnROphrk1Hq2RnVrKSlAHrcWtAV+ey hhBg== 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:subject:message-id:mime-version :content-disposition:user-agent; bh=WNvqLoTkh0fWgkbS/w4CTYn2SASEM94dbBgdk4HmiaM=; b=lGnoS3k/Ek3gpSApLwXLgnPmn77qOxgdZEp9H2F78+nT5bON1dOBc7PUHY/f+u/InL C4ho0V7g11J9AFakv7wA4TMTd5AhT4vngy413qa++k2uR3yen9Qr30ky0HqQPW3KvvMr HalbtBsbQHN1FGeIWpNGygni3c3GgtOEjR1m1iVW9OC4Mo62zqsayOMJwbkRUTcPvcYP 5lmdsfBa4lLXFPnsgPWFwBQiqErNd384foFC4ObJ3lAFMAKZNjV+JBmwRvGZMCfwHAGf hT6iOyTzbNx1yOM19FMLH4pdVhga0mXQxshPFaGf1jzQYExdsSxbVLC4P9wYgPHpTwSg PVjw== X-Gm-Message-State: APjAAAXQkv9wD/febValXCzCSuzFE3OmTklHZCA71gj2MuyBKKoxXw4Y yBhqqwXVmaUQ0pTY9cqLtbx2jj7Q X-Received: by 2002:a17:902:b717:: with SMTP id d23mr43537398pls.53.1559984455089; Sat, 08 Jun 2019 02:00:55 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.89.153]) by smtp.gmail.com with ESMTPSA id p15sm5554623pgj.61.2019.06.08.02.00.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Jun 2019 02:00:54 -0700 (PDT) Date: Sat, 8 Jun 2019 14:30:50 +0530 From: Hariprasad Kelam To: Steffen Klassert , Herbert Xu , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] af_key: make use of BUG_ON macro Message-ID: <20190608090050.GA8339@hari-Inspiron-1545> 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 fix below warnings reported by coccicheck net/key/af_key.c:932:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. net/key/af_key.c:948:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Signed-off-by: Hariprasad Kelam --- net/key/af_key.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/key/af_key.c b/net/key/af_key.c index fe5fc4b..b67ed3a 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -928,8 +928,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x, pfkey_sockaddr_fill(&x->props.saddr, 0, (struct sockaddr *) (addr + 1), x->props.family); - if (!addr->sadb_address_prefixlen) - BUG(); + BUG_ON(!addr->sadb_address_prefixlen); /* dst address */ addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size); @@ -944,8 +943,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x, pfkey_sockaddr_fill(&x->id.daddr, 0, (struct sockaddr *) (addr + 1), x->props.family); - if (!addr->sadb_address_prefixlen) - BUG(); + BUG_ON(!addr->sadb_address_prefixlen); if (!xfrm_addr_equal(&x->sel.saddr, &x->props.saddr, x->props.family)) { -- 2.7.4