Received: by 10.192.165.148 with SMTP id m20csp821272imm; Fri, 27 Apr 2018 08:03:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpSDXytRRz9ClTTNFSmjmrpk+92yWJ47v7pGQig+MDBi/4mf1LgaL16i0L22DsDaEZ8LoQn X-Received: by 10.98.198.217 with SMTP id x86mr2542417pfk.192.1524841407928; Fri, 27 Apr 2018 08:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524841407; cv=none; d=google.com; s=arc-20160816; b=oyJDJ/GQa88HIy/RgmooDZnlZRpLMNb5vDm4ASYlnMG+XwehlRg+4MFoqKABgUyK/x CEQYb73xkX6Ok8WVvyXUMfD0ePxIGiwD54HsiRkUkrakjJADRUc9eTr6Os4iA3fQ99KI qEgEhTmpCf7TliSNCeMvCGy8sItpRSBLoKxA8CyMaGtysvNlu62K7TBED+ORcD2QjnRb ZDAq1kkxtgGOOMPRKiALw7Tg92OBhKiS/pdowSMsRTFfZMbZseVT1u521Zr4M6RaHD2U 2HqU8le6LT+AdPZXDAS6TCUlxKXvbfBxaulFT7LU9Uc4G+t2w46WfT7suoDlSjgTa2iB p2SQ== 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=TOlxH2KggPonQkpgqTnHDRjYzFbxLSCqOGH5d1dh7cI=; b=poy0ukPzVYj6s3XqWr8JkNxpw2HvyQc60YPK5DKBYn5ziR+G7qucIn3MZcMCh624N+ BFpKW9FKujUx55g9nejL6Z4rEvVj4ljEvqJexf7RGIs2BOQHnoh2uuff7MsGfU2iTPLt zwTrnOQh/c1te8SUjaJfF7O1mUACnPOaZc5SRqsBVAlQxehqUNavBc8fbziZw2FBQYD1 H1mXHbsfbsqSkauqPK+FFWW1tvCcYGMTppKGA+Kzh54QoLoB5740SoT0BYmlwRUA+W5g 9cEqIWny1bh+DuM0gj9oZbq95nUoKARS429pBfnh8bhRpsensLQCm9Dd01QyA67E0owo kj1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Mj4Musw7; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3-v6si1365567pgn.471.2018.04.27.08.03.12; Fri, 27 Apr 2018 08:03:27 -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=@oracle.com header.s=corp-2017-10-26 header.b=Mj4Musw7; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934209AbeD0PBk (ORCPT + 99 others); Fri, 27 Apr 2018 11:01:40 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:42286 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933900AbeD0OFd (ORCPT ); Fri, 27 Apr 2018 10:05:33 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3RE1UPE001537; Fri, 27 Apr 2018 14:05:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=TOlxH2KggPonQkpgqTnHDRjYzFbxLSCqOGH5d1dh7cI=; b=Mj4Musw7haPUCgGfxxDigo9x5Q+OpLbri9t8JeXkl/D3dsm9ML9aSI4ykrU8idudreur UghTIK7n1flmZWOpxQ0DhCvnzEZyxkKIaUF8iIQ0QmD5V+hihsInlv5/5G1vexaoIUIr Ays7ZTLUZL1EmtLRGy+SuHAL3G9IuYV+UQlHSv0b56GurEc8n1tZhYIrPYdozFK/LWho g22vb79asDZc5C/JETwA5lwK7uxHIwKhHX2/80miS2jh3mNUE/XFs31q3uD90C5UA6zg YsQRZSZl+92+E3fQp9/YwmhMSOaIRhx8NMehoky8HOChOmR2/Q3Dp1GPBNplWSTCDe0c rw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2hfwy9ypfm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Apr 2018 14:05:09 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3RE57d2010568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Apr 2018 14:05:07 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3RE57Q4018701; Fri, 27 Apr 2018 14:05:07 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 27 Apr 2018 07:05:06 -0700 Date: Fri, 27 Apr 2018 17:04:59 +0300 From: Dan Carpenter To: Alexei Starovoitov , Martin KaFai Lau Cc: Daniel Borkmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/2] bpf: btf: remove a couple conditions Message-ID: <20180427140459.GB19583@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8875 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=733 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804270135 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We know "err" is zero so we can remove these and pull the code in one indent level. Signed-off-by: Dan Carpenter --- This applies to the BPF tree (linux-next) diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index e631b6fd60d3..7cb0905f37c2 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -1973,16 +1973,14 @@ static struct btf *btf_parse(void __user *btf_data, u32 btf_data_size, if (err) goto errout; - if (!err && log->level && bpf_verifier_log_full(log)) { + if (log->level && bpf_verifier_log_full(log)) { err = -ENOSPC; goto errout; } - if (!err) { - btf_verifier_env_free(env); - btf_get(btf); - return btf; - } + btf_verifier_env_free(env); + btf_get(btf); + return btf; errout: btf_verifier_env_free(env);