From patchwork Tue Dec 10 20:35:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 181166 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6403472ile; Tue, 10 Dec 2019 12:36:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzuf9s2YpYpQdE1yFu7XcKbrmE9BuzyWTmBGjQMAPWhpKJfF4/lpXLLqcgivkgjHnKB6yNz X-Received: by 2002:aca:4f48:: with SMTP id d69mr723719oib.103.1576010178773; Tue, 10 Dec 2019 12:36:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576010178; cv=none; d=google.com; s=arc-20160816; b=xvE76uatawUahw1vwHbxX4cmMmCgJUbwigeRBvCpDbqPV+XESjNFvqqggDlgobooZb NHeWhwl3Xl/dQLL37yNrs5ppewAhNCDW9n2SsDuS1v5bXH1f28/QfT0ebv9z5K8nwaNx 4Ay14Te9ojw7gNokMOcq02Sr+SQxzwre9jwh8vDhsfJl+xq53W/eYeBDTmiH2ThMDPP2 lZxk4JaLhycBbrYohDLz5O3BeVn47seN8hmkEtxu2snmHqjO3POOsbRYux7aoaorfN2r Aebfa8QPtGeKZpNIs4ajARsblUy/Byq7kcCSP6+tLTPcV3bBN8AgS3nloQOhfBuUvJt3 7fBg== 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=PIJzeyG/u3bI5RqSS5sUAw5MMy2lnf/UEP/YJT/WKAY=; b=WvPHMHvlycG5QGNjPjLh5eTeMdG5c3so+EG93TbDBZyjRzC3tMUKpxx5p0y8VQDtEj F+C9VzmgiDZD+uJWMCbDCUMqU+P2y/iByHqEDP6tKpZr02ayqjHoWRSgddqwhHDNYLe+ A7XNTRe3ndTlxL6lYNzIux3WjtHo9vuMYN6fQyLZIaVpqnHSqzylhdFISbFuHTWeDYDk VIf7dizp9NCb9gyOJT2a7JmpwH7uZHG/SSdN2R3/0FFKrXiTsaS5dMpJbn8pFBzpzQg5 kUGBDybgJSMNMG9mFfu7we6qwOtdx8n0zIxHu8GX8o9EEXOXDnTktYqU8dDaxmIqZJnh Gviw== 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 j7si2457400otp.323.2019.12.10.12.36.18; Tue, 10 Dec 2019 12:36:18 -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 S1726911AbfLJUgR (ORCPT + 27 others); Tue, 10 Dec 2019 15:36:17 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:47765 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbfLJUgQ (ORCPT ); Tue, 10 Dec 2019 15:36:16 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1M2ep5-1iiuph1YVD-004DY0; Tue, 10 Dec 2019 21:35:54 +0100 From: Arnd Bergmann To: Alexei Starovoitov , Daniel Borkmann , Randy Dunlap Cc: Arnd Bergmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Quentin Monnet , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bpf: Fix build in minimal configurations, again Date: Tue, 10 Dec 2019 21:35:46 +0100 Message-Id: <20191210203553.2941035-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:/TPNkN7ip+x2EGFaeArJV7t8UOMDz3Xt3D+KTG86o+YtHi7AQpl EA0traGRcVUYNiVhb1WcqtyedHFK/G7uo0ODPsfSwvljgdSlfpiB9jNCLcGrp8AhFzBC3Rd 4nUPKrnESghS/cdlCX+dbI/zA0oHna+X0b/mFXnE8c9EQLoI9fPJU9FDHyh3lXC7+LwYcnO MgvBxcOH6E8fFfruQkYlA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:bT0fWJOkfpk=:6CchuXFwP8SMBieEroZBrH AEk/STZiwVmNZ6TG+ImhFDC8ApYwPA7+2PF1wJ1oF4yezz4fciDC2lAIcsYU8l9tOdKyaAspc 0SV4G8rpDiBjXWCLZFHS7Z0Te6aJKDsHTnwW5S830ljYf1BSx2ot7TrIb+leoxWvV/rJpv7G6 s93O3GFciGFrMcGQvg/4y5kuZTog+nYzBYsYTkoMhg94yai9Lt1IRXZ+Hfqgwboq+fyK9dxlB l9BeW0HRcPSCTz/Ffv3pRWOc8grqW1Ch9/qcx8X/MvZc6NZI5Q0pkb9C1F3Luz2JswPZotGUe 3b2aLkC6+GHufoBizFdA/b0KJSMyKqrgfbX/X/ZsxY1LNOZggZZ7D4Azve0M5vAtt9elY0gA9 1O8BK9hMoUxBG7rBjdE86VP0HDrKI3nYXD6GFOXW1asqP8X0sPceT2JqFJ0WORXaDcISz8cMK Ql2klZPu/IBSMdURuGUq/MX7eul0lx+jgH4enSmzY7dZ0A1LiJ9vyGUrwdLbj9qrwmyqRc+kg TH7oDzkvFT7pPOAuqi3JXAyT2MEIRPqIp7Lg3RW6MlfCM+IO1BmLFprg6nq4n9FiNKMEZN+Jc fwQldPMpfVPv/oy+cOmzm3pR+g+W/VRoQvQtsNui5r/0YTD6VxIC3t5mfw9z41bzv60Cdm+Ur KrxfaMaRqcW23Ic55KNRGxmoqmwoIfzyZnL0e85ry9EBbcgd/hCYNDkuvB74++T31XmWyNWdZ MsT72djQzrEtDUsHBD7Tznyn0vpyOO9cMJpdu1OWpNwJfp/kDX9ISul2HBStsFU+t+lf3z5xB 8qrhMqfuRGHL0wlzT9vDVAF2ZruLF9m1EUVzvrSuay9XrZLsyZR0d53z/apMy4yDL2M51VGDd 0BQYnKMJ8IWxWvoy3Jfg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building with -Werror showed another failure: kernel/bpf/btf.c: In function 'btf_get_prog_ctx_type.isra.31': kernel/bpf/btf.c:3508:63: error: array subscript 0 is above array bounds of 'u8[0]' {aka 'unsigned char[0]'} [-Werror=array-bounds] ctx_type = btf_type_member(conv_struct) + bpf_ctx_convert_map[prog_type] * 2; I don't actually understand why the array is empty, but a similar fix has addressed a related problem, so I suppose we can do the same thing here. Fixes: ce27709b8162 ("bpf: Fix build in minimal configurations") Signed-off-by: Arnd Bergmann --- kernel/bpf/btf.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.0 Acked-by: Martin KaFai Lau diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 7d40da240891..ed2075884724 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -3470,6 +3470,7 @@ static u8 bpf_ctx_convert_map[] = { [_id] = __ctx_convert##_id, #include #undef BPF_PROG_TYPE + 0, /* avoid empty array */ }; #undef BPF_MAP_TYPE