Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp466446pxx; Mon, 26 Oct 2020 12:35:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEbu+s0zOvbMRPDcBXoSA66ajBB4WOEMnbRSnyHUxj7ZSWAhMWj7KxqvEhmhBPAaZA4UFR X-Received: by 2002:a17:906:1411:: with SMTP id p17mr17936868ejc.102.1603740943163; Mon, 26 Oct 2020 12:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603740943; cv=none; d=google.com; s=arc-20160816; b=kidoZ8LQO8DcqiZV2A2Yyo2oJtvU/d3rvzs8rsCxz3wFSQCL7XhDHwo8vAeszrvh0E HpAO83Y7eGC9YBVTmV96Co/3BUwA9H07GshYHv5xsfK78MVT2q+Ez9SdI9w190vT+iHV TD5QB+xLCozVcecWdU4+BmKuVwbjiZz0Iaxq3omRxerxYOZkd/uGCwPXiDM1UXJG0kOG fz6fYZUSAFNhd4nCWkQqXk7k6spdANiNeW0AV7x0B+7OWqo+nNjUQ/BFrL7QyCQwoxOf d0ygyk+j1i0B+OmF+E7FWFXeu/Fr7xO7rrDBc8ueD0lk4vfnV9H4iqwrp0IeCM/qBnnJ H3DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CXdlyQMWIwa4rhsekwM37/5eksmSejao6H92iWrTf1U=; b=ZU59x/m+91j2DvcfCEZ14J1mRc3cF5SJvaRbXbzb5cj83AwlVnckM72ylFJBaoc2k4 W1OMYR9weZC+KfpI++ZUgo5D61w0c+pZF55cs9HpAfwunSd/qJOlzWRbbvug3JgqLs9R Y3I2JB6+PTuJhVRzPHK9WWiAgbweVzillPny3S+dirxe4AOytXm7MMQIzHvenUvPSK7F FgZZeg5XPcppqqfeVpwaeYhyCjcAgVZQpq37jIoDJJi+yklWlpwwnmL3Nm9uFSw3gMxa wLRzhzkyUvifDcDABfeSqUXKO/s0+kGgMkzzxyJfHPB9KufksWXutfwhX9rQAhSmaYhw eJSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tAdyWuxL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si7629415edr.557.2020.10.26.12.35.20; Mon, 26 Oct 2020 12:35:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tAdyWuxL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1785732AbgJZQVR (ORCPT + 99 others); Mon, 26 Oct 2020 12:21:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:33632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1785714AbgJZQVR (ORCPT ); Mon, 26 Oct 2020 12:21:17 -0400 Received: from localhost.localdomain (unknown [192.30.34.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 94F9D2463C; Mon, 26 Oct 2020 16:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603729276; bh=zNT9+W068f8fERQD91gIVDc2JWuRGhG2olBuXuEAQR8=; h=From:To:Cc:Subject:Date:From; b=tAdyWuxL2Bzw7oE+dUgBV64nS6vuHJPeka7/xu+pQhqKCdA0l382kbDE+FJimtTmg c78OkIKYOQD9pIb0FAyrcswvqjvO9zb6Qzr5KPUabvhtuYopJtrBGXDRC25fTfZSYi z/B93BmAO3idbxlYJOaKNVja1t4y15i02YGDl3fE= From: Arnd Bergmann To: Alexei Starovoitov , Daniel Borkmann Cc: Arnd Bergmann , Martin KaFai Lau , Song Liu , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bpf: fix -Wshadow warnings Date: Mon, 26 Oct 2020 17:20:50 +0100 Message-Id: <20201026162110.3710415-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann There are thousands of warnings about one macro in a W=2 build: include/linux/filter.h:561:6: warning: declaration of 'ret' shadows a previous local [-Wshadow] Prefix all the locals in that macro with __ to avoid most of these warnings. Fixes: 492ecee892c2 ("bpf: enable program stats") Signed-off-by: Arnd Bergmann --- include/linux/filter.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index 954f279fde01..20ba04583eaa 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -558,21 +558,21 @@ struct sk_filter { DECLARE_STATIC_KEY_FALSE(bpf_stats_enabled_key); #define __BPF_PROG_RUN(prog, ctx, dfunc) ({ \ - u32 ret; \ + u32 __ret; \ cant_migrate(); \ if (static_branch_unlikely(&bpf_stats_enabled_key)) { \ - struct bpf_prog_stats *stats; \ - u64 start = sched_clock(); \ - ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \ - stats = this_cpu_ptr(prog->aux->stats); \ - u64_stats_update_begin(&stats->syncp); \ - stats->cnt++; \ - stats->nsecs += sched_clock() - start; \ - u64_stats_update_end(&stats->syncp); \ + struct bpf_prog_stats *__stats; \ + u64 __start = sched_clock(); \ + __ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \ + __stats = this_cpu_ptr(prog->aux->stats); \ + u64_stats_update_begin(&__stats->syncp); \ + __stats->cnt++; \ + __stats->nsecs += sched_clock() - __start; \ + u64_stats_update_end(&__stats->syncp); \ } else { \ - ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \ + __ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \ } \ - ret; }) + __ret; }) #define BPF_PROG_RUN(prog, ctx) \ __BPF_PROG_RUN(prog, ctx, bpf_dispatcher_nop_func) -- 2.27.0