Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4011243ybi; Mon, 10 Jun 2019 22:51:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+voBX/gQnZeUOC30tqDxSP3vEUu2pIJ/B6Kq3Qk6pO6K/1dDXV3zuOme3PoAVFMfsPk2F X-Received: by 2002:a17:90a:5884:: with SMTP id j4mr26091387pji.142.1560232268178; Mon, 10 Jun 2019 22:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560232268; cv=none; d=google.com; s=arc-20160816; b=yJBn3WnmrWswltRilDenH1SVzBLmBwzD8A2NQoMzn/rO/lyEZF8Sx02k92Lm4jMVFF +xzJSEzKni5qJfnBPRt8RUVtnCxzLQsYuLZHOeNtS1bGwdc3gRcYUXU62zmoEgkFCsdy 9U+3bA0j0kk5C2jNtL9cqN86fQCmGGYLWRlGLABlEaUpYU4TM2ko3f8RnHjoUj5foZFZ tVvMlPT45QWNENF81TLpqnVmMPVhFeVowr3Qcbyt30TbgNttOO0LvBhvd1KBgJd8EX8N GtYuM9eja7JUYZnavGAhGdW4OLKPVw2e98YDusFFwRSiZ95LKhNGZtQWrqStbx0memEt 6/OQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=A5wEeAyNDVZXiW6xkSMzpzOefP4LoMFNlikHzfFKkbA=; b=BtFFl/qbK+Zh51+15ekT59qin+5WkSnDQWXdBCr37zbVkQk4TE3/5J5TLNnR8HmXhV rEH3/8gFd8uQ/lFAlIo/qos8auBhPdz0GY+4WOVB525cVVLn7rOKE93AQ0LGIhBsK95L T3yO2BM8AW9w/3nCC5cSpcf36EEGSCz3h5TdxaL7PjswRyn+Q0fIbUNv375qXFnp/IBQ Lnin82hfuFTxoMkLuWDw+XIH3/RPz4h3jNwg/5J3pANo8ndsvuNH+jCAA10oOJtBtRqI hZ/r62VTPq7Dye3/cFFgOSjZamppIr8+Wj1HAKFB3SKEL0vbM+8rVtuhBiJv0PjO4Ii4 ONKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MEjjALLP; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u20si4506996plq.421.2019.06.10.22.50.53; Mon, 10 Jun 2019 22:51:08 -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=@gmail.com header.s=20161025 header.b=MEjjALLP; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403820AbfFKFrG (ORCPT + 99 others); Tue, 11 Jun 2019 01:47:06 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:36397 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390485AbfFKFrF (ORCPT ); Tue, 11 Jun 2019 01:47:05 -0400 Received: by mail-qt1-f194.google.com with SMTP id p15so5730351qtl.3; Mon, 10 Jun 2019 22:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=A5wEeAyNDVZXiW6xkSMzpzOefP4LoMFNlikHzfFKkbA=; b=MEjjALLPHdnWy5msWX3MwHLfjkl8sZtsl9HKWIhJrzZM6n6n7RND9/LRrdhnkLWZYH bGgxrVSPjyLG+VaGT9Xfee2TCU4N2HhtqdQ+rMmV6v1oZe2s6spwrsyXx+5WQjuf7I8+ x1ugPkDN54ZiERf4RreN2BtDBYh16gtxL0l02ILc5ZtYGDAGmtmeuUkfkX58ckBknQs9 sMNmWz0FjAw9FXm0UCaFvzZ0OOfXNyxMIC4LRdH5TDrjPZSPkCr75dcZuH1jx2963hd3 e36Z8rcwEUMvUeWvBrK4czZouDeX2ZN35sw1nz2EDY4sD73pA9zzij7Ez+mHaYhpZ1Dk obsQ== 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:content-transfer-encoding; bh=A5wEeAyNDVZXiW6xkSMzpzOefP4LoMFNlikHzfFKkbA=; b=Gp5jMIxSJQCBq+skH1VYNSsfLb5v4/8KJD8KolIWWhvH6XcRHqoza4JDUt8UHj94Yy xrHXvBQCruxZiyBqH2DsYW0x/Q5Glq3kIJ7fAiruXl/lkKfaooGmCJFNEh2t6IWvehO/ ZzYBHIlJxWmez8cXujdrk62hUHIORgJR5SAUyumBdnbpcbd1gCoQtQS16/ZFAtSlylYQ s0AhZFa7GWFMc1juWXau5vOxO8CXjIf2wkm/b/Vk0ZVEESj4Mu0KIJlRxtMZMDyFheMq rvGC0SAbRvvgyF9WCN4rVJYbzdbdBaUNhIi5yzXrAYHdKJy4t96ppgbJUCq75DVbT7cV USKw== X-Gm-Message-State: APjAAAUWJmC8+qttN8Z5tpUEKFOIKyotnGpz8wVCd55nRIK4e6PhlZOm +kFnXqyOBi7729/wfsS+eCoebf1B3GaM6e3WRwA= X-Received: by 2002:ac8:2d56:: with SMTP id o22mr12538069qta.171.1560232024706; Mon, 10 Jun 2019 22:47:04 -0700 (PDT) MIME-Version: 1.0 References: <29466.1559875167@turing-police> In-Reply-To: <29466.1559875167@turing-police> From: Andrii Nakryiko Date: Mon, 10 Jun 2019 22:46:53 -0700 Message-ID: Subject: Re: [PATCH] bpf/core.c - silence warning messages To: =?UTF-8?Q?Valdis_Kl=C4=93tnieks?= Cc: Alexei Starovoitov , Daniel Borkmann , Networking , open list , bpf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 6, 2019 at 8:08 PM Valdis Kl=C4=93tnieks wrote: > > Compiling kernel/bpf/core.c with W=3D1 causes a flood of warnings: > > kernel/bpf/core.c:1198:65: warning: initialized field overwritten [-Wover= ride-init] > 1198 | #define BPF_INSN_3_TBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] =3D= 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_insntab= le[12]') > 1198 | #define BPF_INSN_3_TBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] =3D= 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 overwri= ting > the default initializer. That leaves bpf/core.c with only 6 other warning= s, > which become more visible in comparison. > > Signed-off-by: Valdis Kletnieks Thanks! Please include bpf-next in [PATCH] prefix in the future. I've also CC'ed bpf@vger.kernel.org list. Acked-by: Andrii Nakryiko > > diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile > index 4c2fa3ac56f6..2606665f2cb5 100644 > --- a/kernel/bpf/Makefile > +++ b/kernel/bpf/Makefile > @@ -21,3 +21,4 @@ obj-$(CONFIG_CGROUP_BPF) +=3D cgroup.o > ifeq ($(CONFIG_INET),y) > obj-$(CONFIG_BPF_SYSCALL) +=3D reuseport_array.o > endif > +CFLAGS_core.o +=3D $(call cc-disable-warning, override-init) > >