Received: by 10.192.165.148 with SMTP id m20csp972254imm; Fri, 27 Apr 2018 10:23:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrEUfriVr+BmR6YnZWcz3T9NNDbxjnmqFhkZ8Yzx6t6hPhCM6OErDiwoUe34/AhkDopx7AO X-Received: by 10.98.161.17 with SMTP id b17mr2622457pff.132.1524849810637; Fri, 27 Apr 2018 10:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524849810; cv=none; d=google.com; s=arc-20160816; b=an13oohicoXrkPozmoyEPQEeAqrc559mdXrsI9IGOmzqwQRYqYnZZbw8NPy3UgI3T1 q8l3CNGh13q/pO/Fur/JdtutJq9bBAtqc/OVtmK/gdi1/OI1jtt6+kV8/2FGSIhkGgVq zcPiqUF6RW3FLP0nw8um/z4REH0kSBSZP1nq1z0Zk26GdAT9DMBYLaI4bFuRGuvCLLtp ZdWfjl2HkfyiE1OPsSHgzsspt5GiwWkdg+i18vLKftmi9jjsQcO0MqucPoIpYU9CjdLM eTNu1aHRvGrmSWrXVu01wdWisObom0Bx3nEBLqYn0xWFxdRkaSyUTTtc55LJHDEO5Pg0 dOTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=lQZtRUbODjPlNiBcbZ0tGYsxVl+GJZyp03LF05vWUNc=; b=J/rcadUt4HLAdN4aCXShFedbrpJ8i7svy2k020G/oztpSMcwGBzcC5wDUlRKtzosRd Zc9vNZEe01Ep2QpMTvgOHbtF5YOTSHr5rpmigOzgxGNsIM+lLWrBLeLeeLI79u4YBzP+ e+MK+5GEtL25Yqqyncyr5XUpuOkgapeQMtP7TaEtb1nmfmAgmlfGtISu/V95vXkPfwjE Tcqbl0u4lslJqa57bkVPoZh51gMf52g6GSdnQs/ywXwYxdJK7sdQt5xP9bTBqzuK0kDE yEtgYIcHGeTia8jd/1bX1PHOsDxYH/WZuYa8iomOwOvNn3489IFFKEKFP1+ZmpDdeuhg oR8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=Z7hdRleh; 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=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 85si1646086pfh.176.2018.04.27.10.23.16; Fri, 27 Apr 2018 10:23:30 -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=@fb.com header.s=facebook header.b=Z7hdRleh; 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=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932877AbeD0RUx (ORCPT + 99 others); Fri, 27 Apr 2018 13:20:53 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:42690 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758566AbeD0RUv (ORCPT ); Fri, 27 Apr 2018 13:20:51 -0400 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3RHI1ww009299; Fri, 27 Apr 2018 10:20:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=lQZtRUbODjPlNiBcbZ0tGYsxVl+GJZyp03LF05vWUNc=; b=Z7hdRlehCQfb4hIw23Yxz35FldHXDCYrWj0d64ZLbWW/0uR0x93eehfIIrHkcJNSIOOX 3BXINKJNsb55HUSHiCdp6n67rXvjQ7Gtxxapd2MiQ3aW21GwXVEA+h92eNVN3Otm4RiS Ayyn/86rMKBOv8eKgcUUs7ceEfOxyVtHIc4= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2hm77506tw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Apr 2018 10:20:27 -0700 Received: from kafai-mbp (192.168.52.123) by mail.thefacebook.com (192.168.16.21) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 27 Apr 2018 10:20:25 -0700 Date: Fri, 27 Apr 2018 10:20:25 -0700 From: Martin KaFai Lau To: Dan Carpenter CC: Alexei Starovoitov , Daniel Borkmann , , , Subject: Re: [PATCH 2/2] bpf: btf: remove a couple conditions Message-ID: <20180427172023.6japncdd3nbqauzn@kafai-mbp> References: <20180427140459.GB19583@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180427140459.GB19583@mwanda> User-Agent: NeoMutt/20171208 X-Originating-IP: [192.168.52.123] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-27_05:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 27, 2018 at 05:04:59PM +0300, Dan Carpenter wrote: > We know "err" is zero so we can remove these and pull the code in one > indent level. > > Signed-off-by: Dan Carpenter Thanks for the simplification! Acked-by: Martin KaFai Lau > --- > 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);