Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8609224ybl; Thu, 16 Jan 2020 20:50:30 -0800 (PST) X-Google-Smtp-Source: APXvYqx9Z1286hGdyVq6cV71mYsqRk8PD/LqWoKvdEXYdl7kv+HU3Cryrx3Zy8qIPPakNid484Fe X-Received: by 2002:aca:f1c2:: with SMTP id p185mr2111589oih.87.1579236630014; Thu, 16 Jan 2020 20:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579236630; cv=none; d=google.com; s=arc-20160816; b=Dl/olopmmkZtLE1f7FcAcvCuvFlFNAzLCdLjIoqQ71hdQWCRFSkkx91ya8oKNHnUQQ eXE9HvKm2PG0jDL2eQeX4nvD9IurjUTQFPScXj3TUNCbZdfjML9gu+TBup/2UjDFfCwf B6sJgsDGRtHqMR87FqzAPx1QYTF/WrFBfVskHCSyASQHXQtfP4p3Xoycfq0U9n0b6/1q wlTHruk5wlgP1+V1O7emEnnp9jaevEFXt26B3xpINmJLaT9FGftjAt4TILa6I6YuJCJm mQBAE8CMl6RehAc7KxldIDVtbGSTrdQC1LnGHQF2kQa+2LH8rJ8VNIE1Yu6dUKxPuwJz 3R+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=pm7yctWXySy9C2T/6qcfkqKUjJL7wyLsf2MlCGo4DDQ=; b=v3haAwdzIWxw2tzod8OIaJxOkyzs1VqBjzQBW81VI6rgBedDVDiuba0jvf4a8/8EDW rrPYC7oxhRzoMKjeO0ibnkmIvEcYesWzKrRbu0ync9yqrYt0plAYE1SBBfzGj27T2H8c NbPtEEMEB8VbLVAkBntAb9UyKkqnxj4DAAWZQ/WPTsdE//p7nkbF6YarxrrAvKdWYIye MEsOmrDqYn66uPRniA5J9jpmh0ytmnjH6h5yvLTRmzf4++/csdqhpJCjRtfNwHpI7LMb 00dNfHRftmRse7Uidksmwxqbxp19Gdv7Hb/xSlPswS6bKfTYKwvPduH7Y2hulXIb9uiR Aa+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="aW1/vwIH"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si13945577otp.30.2020.01.16.20.50.18; Thu, 16 Jan 2020 20:50:30 -0800 (PST) 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=@google.com header.s=20161025 header.b="aW1/vwIH"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388543AbgAQBli (ORCPT + 99 others); Thu, 16 Jan 2020 20:41:38 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:37686 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729031AbgAQBli (ORCPT ); Thu, 16 Jan 2020 20:41:38 -0500 Received: by mail-qk1-f196.google.com with SMTP id 21so21277023qky.4 for ; Thu, 16 Jan 2020 17:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pm7yctWXySy9C2T/6qcfkqKUjJL7wyLsf2MlCGo4DDQ=; b=aW1/vwIHnbtPolixVhPtJ9ZF9h4AE0pAFamuTUfIg+YMrLZEZeXxEqeN3ifNrHy+3L qZ+QqF6yNzBwDl56eOQPl3I0kgtSaz6aS4/TokHXPfJfDPgDGm86vMnCobzJS08FjByK UMeNB9Y/3bjctgZQ0A3BFUK4/mCafSK81/xmf7QF9C+BboatiLXcORLDW/vXbLaSVEYF uoVQJifS6qHdY0go14ympv5N+lsHpt0Bt0G0Z4z6877QEzi4PsLAAXMRN8W5FRLOyGwu woF6U5O3w4DsH4GUbJXO0t/z5QEVw3XMERbLh0eqvrJ416HaCx5aUtF8BEefTfotw/wu OLGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pm7yctWXySy9C2T/6qcfkqKUjJL7wyLsf2MlCGo4DDQ=; b=KvA44w5RwAYELbOkVSaEfqsk13DkUutK4yNOIoXpWfnUH4jbWV8PThtreX1tM6dZM2 j6iQ5s6fG6NBvw81+rn32ASTWiGf2ecJIyCeLOgd4pQPbSls7AkH0DnKx4xnZQtONa8e 3PaHWJdeexg04E1nE7614Idcwr8oTEhQN3B3dXKEkKASRMVsa1mGSs6QYJ5MO5d7aORP PsrtaAnkFphtJ2/rY2tHPBPQ0KYSM03057EBpqyO5Zo7LvmM9qRCfcFOZ6QH9amkKZPH T7fTnH0jEoo3zF/nBtKCDgHM2E+ZErA6i52Ys80gRTqJc0f9DvJQVduZETG+BxuBtyWW gYKg== X-Gm-Message-State: APjAAAXzRKqkndkVoNq4kmUTjYB2TyeQzE9a+L33JSYp20+Sy41MXzWs fHKbj3AVujEgN4MqlCyEI96IYjP1TnE7w89YlfLunw== X-Received: by 2002:a37:8ac4:: with SMTP id m187mr31316626qkd.277.1579225295498; Thu, 16 Jan 2020 17:41:35 -0800 (PST) MIME-Version: 1.0 References: <20200116145300.59056-1-yuehaibing@huawei.com> In-Reply-To: <20200116145300.59056-1-yuehaibing@huawei.com> From: Brian Vazquez Date: Thu, 16 Jan 2020 17:41:24 -0800 Message-ID: Subject: Re: [PATCH bpf-next] bpf: Remove set but not used variable 'first_key' To: YueHaibing Cc: Alexei Starovoitov , Daniel Borkmann , kafai@fb.com, songliubraving@fb.com, Yonghong Song , andriin@fb.com, Linux NetDev , bpf , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2020 at 5:38 PM YueHaibing wrote: > > kernel/bpf/syscall.c: In function generic_map_lookup_batch: > kernel/bpf/syscall.c:1339:7: warning: variable first_key set but not used [-Wunused-but-set-variable] > > It is never used, so remove it. Previous logic was using it but I forgot to delete it. Thanks for fixing it! Acked-by: Brian Vazquez > > Reported-by: Hulk Robot > Signed-off-by: YueHaibing > --- > kernel/bpf/syscall.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c > index 0d94d36..c26a714 100644 > --- a/kernel/bpf/syscall.c > +++ b/kernel/bpf/syscall.c > @@ -1336,7 +1336,6 @@ int generic_map_lookup_batch(struct bpf_map *map, > void *buf, *buf_prevkey, *prev_key, *key, *value; > int err, retry = MAP_LOOKUP_RETRIES; > u32 value_size, cp, max_count; > - bool first_key = false; > > if (attr->batch.elem_flags & ~BPF_F_LOCK) > return -EINVAL; > @@ -1365,7 +1364,6 @@ int generic_map_lookup_batch(struct bpf_map *map, > } > > err = -EFAULT; > - first_key = false; > prev_key = NULL; > if (ubatch && copy_from_user(buf_prevkey, ubatch, map->key_size)) > goto free_buf; > -- > 2.7.4 > >