Received: by 10.192.165.148 with SMTP id m20csp1004015imm; Fri, 27 Apr 2018 10:57:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpAhu5DPfyF2GHq4zmdxRmFRG3+MA7ooCxe9g5Sg2fqs3HIp6p4HElEnp7N28DP2cLpe4xa X-Received: by 2002:a63:6d0b:: with SMTP id i11-v6mr2877016pgc.276.1524851868288; Fri, 27 Apr 2018 10:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524851868; cv=none; d=google.com; s=arc-20160816; b=TCXny57wRZNRXlE4wq0Q5QGzevwHcYNnRwWTjOwnlK+GkTuq32HbEqJoz2odRFm/FS sv3G9IVurKVScnS9vC5c2I7soHPuCXT3BTdZoIuWSb+C8EIph1aFkbfVqtHTOqZ4SP+i QxLiQm6+NIi9HoAXXUkbXlgfPcx0uv+pqQ3UhfoOE0LewuCG9dj9CslwEK/BmRmWDPfV OLxNZwhSDb+b1uTiVrZ9IKXk3tWEK+Y5aMy4CXuiSkNMHE4p1TMwtNyAX+vHHnFrpW1F bIx5Ec4xANWVTXGrBFzrCt+qQCYV4wPHJXBZcoekV6/LOnAjgRL56grwKAA6QhUWNCHO AeYA== 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=/vPwsuSs+2SpEGvLDS/f5SlAWTNreBxAcvWFQy0eXOs=; b=IT01tq9e0Kg2J1jPEPjmB30/ZEIwJnDxdGJT09HxGfZltY7+y5UE5papRay9aB9kBL c4t39VTVRGDBhm0Bylq4LGgNFwAWQb6Rw8KfiNgQPE2ZvKf9i8rZsPPZ/tU/yKsbuF16 0WhAPRoYmbgc0xNFXEnkwsQ3QwlMJYW/jFrFs1sum6b0qO2KCs1KTQvW0b1ABV40wm1R T8HoyNyPG/ADsJfL0XDA2utaYt3YwbBVHnbqpZjkW3hMEJePKJVqJmqJeOcZnQm3Yv13 3I8DGgM7qgUKVLmTdSIJWcHCGME3T568NALQDdJ3sR2a+khZyMdP5q8LspkiH/KdnmZb jDRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=VEoEF6ic; 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 n6-v6si1648042pla.12.2018.04.27.10.57.23; Fri, 27 Apr 2018 10:57:48 -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=VEoEF6ic; 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 S932401AbeD0R4O (ORCPT + 99 others); Fri, 27 Apr 2018 13:56:14 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:38168 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751753AbeD0R4M (ORCPT ); Fri, 27 Apr 2018 13:56:12 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3RHsmuG029604; Fri, 27 Apr 2018 10:55:48 -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=/vPwsuSs+2SpEGvLDS/f5SlAWTNreBxAcvWFQy0eXOs=; b=VEoEF6icR6et47nQL+owou+sijiKo7rGO0IROzx0S9fTgAd0F4haisENcFUJFtn96VOT dMM2DlPdFTMTwiwHTA+mEiYuGnoDvph8uy/+WZXucCsJGQaKj1+3dqMIfqWcZUUuzuSO 8dyRKvYUDUXcj6PvLuHc1/EuYi0TDoV7DgE= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2hm6d08en6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Apr 2018 10:55:48 -0700 Received: from kafai-mbp (192.168.52.123) by mail.TheFacebook.com (192.168.16.18) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 27 Apr 2018 10:55:46 -0700 Date: Fri, 27 Apr 2018 10:55:46 -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: <20180427175544.vydqf4iufopcyv6d@kafai-mbp> References: <20180427140459.GB19583@mwanda> <20180427172023.6japncdd3nbqauzn@kafai-mbp> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180427172023.6japncdd3nbqauzn@kafai-mbp> 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 10:20:25AM -0700, Martin KaFai Lau wrote: > 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 btw, it should be for bpf-next. Please tag the subject with bpf-next when you respin. Thanks! > > > --- > > 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);