Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4441578ybi; Mon, 3 Jun 2019 10:55:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzB1N5M2xGHyMAFrK5Co2lIVHe+lt1Pn1Pg4LmaSLQnDbmvQ+b7ewjjrvcRZuOVvkMU1sox X-Received: by 2002:a17:902:e65:: with SMTP id 92mr30270736plw.13.1559584510891; Mon, 03 Jun 2019 10:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559584510; cv=none; d=google.com; s=arc-20160816; b=Yz6Ava/dhwfuWlwDBwXV7VcoYI6bgu2alnFqxFASUAQH7GH7yb9h6pvRuk2GakYRai yoi0TPBmBPvE/S7RYxmLs8xVs52dY2pxvBUXOqBPzwXbf+572Cjwf8wkCJRRGv14ZMKQ c68oGx0oY9pEpp/4PHnjeTxYyuGnR9D6mOpLNRvo4nb1c2Yu1yyjGZRQx5dGoSFgtW3Z PxNzpO2XYMB3YFx51FIDvcb97I4PtHiP3JFZD0bYSc4ETt2R2B3QZP+Dd0SO2H1ReijZ GnQJAq4x02zzuWGLqI3UMO8CE2HNjPy+CGkWgsMGaala22dOs4J6UXriywmpubpbPnYL kGug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=92E/O3TNJFBjLw+i4mbc/GpVyD3IIMyOQNcli5QySv8=; b=fWG0D4Vhw6PM4xU9zVCYH67ixgTHwgcRw9Z7HVYxd8T2nzxM+5kj3PQXXbktHTMWr6 rqc7ybe/Avmc866sdF99KCgVdMw7+P97S0yE0nbxk/R4w1VUUmKT/jaqCakPvekviE0H aa7c7YkeMm8sa2lBZ+kWkBZx8VyKBHOLz8NsyBCRZInSPF6SRWy1xEtALseCKdvvLvAx yDclVtZtkXza/B+N7uFUMhzRGl/HLytIGDgZ0BNhUm4rbaA76t8YY2dW4zndJJuNB6+T FsfpkvMDHSaLlXq+DwM+oecG/lKUmYAcsFOF2v5kFu6Y+PXuwbkUso8hPBpFcwR0Hi/1 A4hw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14si18500320pgg.169.2019.06.03.10.54.54; Mon, 03 Jun 2019 10:55:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727349AbfFCRDB (ORCPT + 99 others); Mon, 3 Jun 2019 13:03:01 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57963 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbfFCRDB (ORCPT ); Mon, 3 Jun 2019 13:03:01 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hXqMB-0004iE-Uh; Mon, 03 Jun 2019 17:02:48 +0000 From: Colin King To: Alexei Starovoitov , Daniel Borkmann , "David S . Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Magnus Karlsson , netdev@vger.kernel.org, xdp-newbies@vger.kernel.org, bpf@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] bpf: remove redundant assignment to err Date: Mon, 3 Jun 2019 18:02:47 +0100 Message-Id: <20190603170247.9951-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The variable err is assigned with the value -EINVAL that is never read and it is re-assigned a new value later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- kernel/bpf/devmap.c | 2 +- kernel/bpf/xskmap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index 5ae7cce5ef16..a76cc6412fc4 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -88,7 +88,7 @@ static u64 dev_map_bitmap_size(const union bpf_attr *attr) static struct bpf_map *dev_map_alloc(union bpf_attr *attr) { struct bpf_dtab *dtab; - int err = -EINVAL; + int err; u64 cost; if (!capable(CAP_NET_ADMIN)) diff --git a/kernel/bpf/xskmap.c b/kernel/bpf/xskmap.c index 22066c28ba61..26859c6c9491 100644 --- a/kernel/bpf/xskmap.c +++ b/kernel/bpf/xskmap.c @@ -17,7 +17,7 @@ struct xsk_map { static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) { - int cpu, err = -EINVAL; + int cpu, err; struct xsk_map *m; u64 cost; -- 2.20.1