From patchwork Mon Mar 30 21:13:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 6125461 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BE646BF4A7 for ; Mon, 30 Mar 2015 21:15:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F31DC20429 for ; Mon, 30 Mar 2015 21:15:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11A8E20434 for ; Mon, 30 Mar 2015 21:15:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932076AbbC3VNu (ORCPT ); Mon, 30 Mar 2015 17:13:50 -0400 Received: from mailrelay107.isp.belgacom.be ([195.238.20.134]:48291 "EHLO mailrelay107.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753645AbbC3VNs (ORCPT ); Mon, 30 Mar 2015 17:13:48 -0400 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=pojTLeLEEG+IB9MeyQ9xnWKWJHiyH+4Hnj5iAYu/pCk= c=1 sm=2 a=ExwLHuKj3s2AkFddTTgA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CzBgDBuxlV/yA2QFdcgwaBLrIWAQEBAQEBBQF7mBYCgTxNAQEBAQEBfYQVAQUnLyMQUTkeGYgzAcwMAQEBByKGD4oSBxaEFwWaUIs7iHoiggIcgVI8MYJDAQEB Received: from 32.54-64-87.adsl-dyn.isp.belgacom.be (HELO localhost.home.) ([87.64.54.32]) by relay.skynet.be with ESMTP; 30 Mar 2015 23:13:47 +0200 From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Fabian Frederick , "J. Bruce Fields" , Trond Myklebust , Anna Schumaker , "David S. Miller" , linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 7/9 net-next] sunrpc: replace if/BUG by BUG_ON Date: Mon, 30 Mar 2015 23:13:15 +0200 Message-Id: <1427749998-28464-7-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427749998-28464-1-git-send-email-fabf@skynet.be> References: <1427749998-28464-1-git-send-email-fabf@skynet.be> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Fabian Frederick --- net/sunrpc/auth_gss/svcauth_gss.c | 9 +++------ net/sunrpc/svc_xprt.c | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 1095be9..09f8a1c6 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -840,11 +840,9 @@ unwrap_integ_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct g return stat; if (integ_len > buf->len) return stat; - if (xdr_buf_subsegment(buf, &integ_buf, 0, integ_len)) - BUG(); + BUG_ON(xdr_buf_subsegment(buf, &integ_buf, 0, integ_len)); /* copy out mic... */ - if (read_u32_from_xdr_buf(buf, integ_len, &mic.len)) - BUG(); + BUG_ON(read_u32_from_xdr_buf(buf, integ_len, &mic.len)); if (mic.len > RPC_MAX_AUTH_SIZE) return stat; mic.data = kmalloc(mic.len, GFP_KERNEL); @@ -1595,8 +1593,7 @@ svcauth_gss_wrap_resp_integ(struct svc_rqst *rqstp) BUG_ON(integ_len % 4); *p++ = htonl(integ_len); *p++ = htonl(gc->gc_seq); - if (xdr_buf_subsegment(resbuf, &integ_buf, integ_offset, integ_len)) - BUG(); + BUG_ON(xdr_buf_subsegment(resbuf, &integ_buf, integ_offset, integ_len)); if (resbuf->tail[0].iov_base == NULL) { if (resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE > PAGE_SIZE) goto out_err; diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 163ac45..2f82e8b 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -960,8 +960,7 @@ static void svc_delete_xprt(struct svc_xprt *xprt) struct svc_deferred_req *dr; /* Only do this once */ - if (test_and_set_bit(XPT_DEAD, &xprt->xpt_flags)) - BUG(); + BUG_ON(test_and_set_bit(XPT_DEAD, &xprt->xpt_flags)); dprintk("svc: svc_delete_xprt(%p)\n", xprt); xprt->xpt_ops->xpo_detach(xprt);