Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5855917ybl; Tue, 10 Dec 2019 12:38:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzZWxdRMBJgpSfFWzrQ3DjdILkdybXLQ7IJGHWClmcikDEoQfFvVdKy5PC3ynX9S+TxzErP X-Received: by 2002:a05:6830:4a7:: with SMTP id l7mr26095553otd.372.1576010315594; Tue, 10 Dec 2019 12:38:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576010315; cv=none; d=google.com; s=arc-20160816; b=ZsdL8lQmtlWX7Vm/wDDLe73av6J5hoLZBCoLSHH7D7jz4Y3tZxcHFybjYGa2XzfNlE JOiKqUKUmnk0q93e5IlEg1YpkXR480ua2sCYBOv2+ellvQRZ72zmFCTqbb/jFopHl4+4 m6rMJdpwOto6YsJrKu0KGV/CAFwEXtOrw7ych4MgxVb6ip26tawXlQpKVwdZ/7GY+Q4p UNB1edtaFYb9QRHpya8L6DuGvLxkQ9RFEz8rq5JOTLxvPjTPe96D9ktG/gKMbAe9yOoE WHfHsEeyGUPMzBcdkbjAPT2+KRDfjv+ZKiLJqBF3HBoP2uM+gv+fG+3lIIWPq4EBTTpY NHzQ== 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 l7si2658565oil.77.2019.12.10.12.38.23; Tue, 10 Dec 2019 12:38:35 -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 S1726879AbfLJUgR (ORCPT + 99 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 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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(+) 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 -- 2.20.0