Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4012485imu; Mon, 28 Jan 2019 15:22:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN6DuBO9zhkySp2nTGv8uWNU6K3a15iBCA7bkSaEzdywYjrphmNTv/WAzWaeGigiC0/GnwfP X-Received: by 2002:a63:5207:: with SMTP id g7mr21823365pgb.253.1548717774061; Mon, 28 Jan 2019 15:22:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548717774; cv=none; d=google.com; s=arc-20160816; b=KDprUn292sH1XcPpxHgfxkKGWLvLCKtCt0OtqI4RMQPBCg5lGUHF0/g3kKCV2tmBRy okjGXgdBYck7RT+PNvSWS+oIH8C+BPXiVRs0cyc68r45WVmBaCDuIiOrKqx5iksHqZr8 4q9Z236zx7mPXUyEz2FnozTEW+quphYcC6g8FGrr3vdboDx6kjbUNw2KYTItrB5J6Op5 +M806FMu/U+JC3N3s3H87jPBY+BTbP+J8qtPh4isVqdxyWDW/Krvrq7ICVwr6jNb6YM7 8Ng39JVaCIrbQCzPBRjyeChrpKFeHYn0LA/RKLkw0glwI6OJu+MpUtWPrVtGFYN4BeAN qD/w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=goVfP717RQO9bPSDVczFe/QjtI7PJGBOJnNgAVHEJOc=; b=r5lh7MTg+Wzcvwt+FGVOvWAKFwYILOAhgx0ipblrgsXEnHMC0WizeC+xg35f46E3eC t7o4tqVrkX+YgUCMhy+mGQdu5wzm8PMDL65DufgifJyNtNiOcg9vp6jCyV864j4ctq2n snvazxxKnQFOGP1FWKErGC425f7RdA1LkgaoEKngZuuhxy8cnCDuvfh9+FuAiS/Pkiey QDD5NYMA+sD8ep+NCuW3/sPx8PohNgK6zpglB4dj54rsZKROCncfTLajhYmduAYaIz08 bwvTIIc9rHh3kv6oRpMQvgWstg2TdtKDrop9Q3M7kCFzOcNsgortDDcvTPF0OZGyQxUe MrtA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3si21009913plr.376.2019.01.28.15.22.36; Mon, 28 Jan 2019 15:22:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbfA1XWc (ORCPT + 99 others); Mon, 28 Jan 2019 18:22:32 -0500 Received: from www62.your-server.de ([213.133.104.62]:44220 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726750AbfA1XWc (ORCPT ); Mon, 28 Jan 2019 18:22:32 -0500 Received: from [78.46.172.2] (helo=sslproxy05.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1goGEV-0007hv-7t; Tue, 29 Jan 2019 00:22:28 +0100 Received: from [178.197.249.31] (helo=linux.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1goGEV-000OWI-16; Tue, 29 Jan 2019 00:22:27 +0100 Subject: Re: [PATCH] bpf/core.c - silence warning messages To: Song Liu , Valdis Kletnieks Cc: Alexei Starovoitov , Networking , open list References: <31468.1548648675@turing-police.cc.vt.edu> From: Daniel Borkmann Message-ID: <3c8c866f-c665-ff82-a0ab-a4eafd28b20f@iogearbox.net> Date: Tue, 29 Jan 2019 00:22:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.2/25339/Mon Jan 28 19:32:47 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/28/2019 06:18 PM, Song Liu wrote: > On Sun, Jan 27, 2019 at 8:43 PM wrote: >> >> Compiling kernel/bpf/core.c with W=1 causes a flood of warnings: >> >> kernel/bpf/core.c:1198:65: warning: initialized field overwritten [-Woverride-init] >> 1198 | #define BPF_INSN_3_TBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = true >> | ^~~~ >> kernel/bpf/core.c:1087:2: note: in expansion of macro 'BPF_INSN_3_TBL' >> 1087 | INSN_3(ALU, ADD, X), \ >> | ^~~~~~ >> kernel/bpf/core.c:1202:3: note: in expansion of macro 'BPF_INSN_MAP' >> 1202 | BPF_INSN_MAP(BPF_INSN_2_TBL, BPF_INSN_3_TBL), >> | ^~~~~~~~~~~~ >> kernel/bpf/core.c:1198:65: note: (near initialization for 'public_insntable[12]') >> 1198 | #define BPF_INSN_3_TBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = true >> | ^~~~ >> kernel/bpf/core.c:1087:2: note: in expansion of macro 'BPF_INSN_3_TBL' >> 1087 | INSN_3(ALU, ADD, X), \ >> | ^~~~~~ >> kernel/bpf/core.c:1202:3: note: in expansion of macro 'BPF_INSN_MAP' >> 1202 | BPF_INSN_MAP(BPF_INSN_2_TBL, BPF_INSN_3_TBL), >> | ^~~~~~~~~~~~ >> >> 98 copies of the above. >> >> The attached patch silences the warnings, because we *know* we're overwriting >> the default initializer. That leaves bpf/core.c with only 6 other warnings, >> which become more visible in comparison. > > My concern is that this will also mute the warning for other parts of > bpf/core.c. Agree, valid concern. > Maybe we should move bpf_opcode_in_insntable() to a separate file, and mute > warning for that file? I think moving in separate file would be overkill, imho. However, lets get the kdoc and prototype warning fixed. Thanks, Daniel