Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3201742rdg; Tue, 17 Oct 2023 07:34:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7pGVD4QPsCdF8hls7q9zdN0yRDeuDYAb5yB2iZOMvvfUJ6htWsfmApi/eflqHZ71FBNjQ X-Received: by 2002:a05:6a21:798a:b0:14c:3218:c1bd with SMTP id bh10-20020a056a21798a00b0014c3218c1bdmr2069831pzc.11.1697553270771; Tue, 17 Oct 2023 07:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697553270; cv=none; d=google.com; s=arc-20160816; b=Dvm4bXLaubG/suAnWNfhdy9ghrN3olpMpf+nQ5g2e280X3bOwfO+MsqkQ8fq56E7w8 OqJgtnMD+MphmpuTQcC7FRddGNRixwH5NeU314SX8QseM5g0DsYZB8NJyGJjkl6UMV73 peyo69fwJhpJmf5dS3ETRqQse9Bz2Skx2KBTZfeUD5Dhl84oDmC9HrFOXMc43HQn5oo2 kGfzuUxcA1OWMFudMQz2FVoHwtuPojS/S2RKHRQKd58p76XKLCMkyDjVBCaIsRESS6uL ssNCHrTs0fcfcsEWP0ryI8/janHj23zAnZH8reuFuo2Ujy+gHbUuKWQ5ZVV2OFZCWLIg 95VQ== 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=XFkhbcMuzE1RrMvC4jI/IMTTM/oTw/sUXhYkrcPnQVY=; fh=emP0J7Hmy7DUy9iklv6bXzH+ss6aVyHRc4EnkYwxK/8=; b=Eo7wT+vS1TQgy07nGYGsUCuG5kahwMzh1rj3rnFZ83uS35R0e3X/lj7R2o8wAPXWuZ 6bMb2Wyl5u4QqHqd7ALaE+FWN/PH679ZTkFx+XQsvM3WpE0OfwpputLld7ecdliidsPS +uIDV3mU40ZLTHP6yRN3JtMAKyRFOWH12YmRKe+K1fIXMzp1YHYphEKWEFSLlEy3oyri YzlbJkn09n3MsadaYMUKWMTnxcyfkccNAAt4FgphtpL7zDj0c/jb0Q8Z5JG+CO0yGAGi 8Fyv1tVq7J5WG+K1mNMHGf9BhJNDISnckV+ltd2Z957H2XcqTtpJB7UvNlK+V4uLvp+o 833A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="F4ZSSv2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id c14-20020a17090a558e00b0027763f3e3c8si1760134pji.186.2023.10.17.07.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:34:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="F4ZSSv2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id ADD438027E21; Tue, 17 Oct 2023 07:34:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343882AbjJQOeQ (ORCPT + 99 others); Tue, 17 Oct 2023 10:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234917AbjJQOeP (ORCPT ); Tue, 17 Oct 2023 10:34:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F1B9A2 for ; Tue, 17 Oct 2023 07:34:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A5FAC433C8; Tue, 17 Oct 2023 14:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697553254; bh=6chpSi2cSFs/mmCxw/PjMVSCy+uwdZlMJRYapzy+Luc=; h=From:To:Cc:Subject:Date:From; b=F4ZSSv2/78hTJu0ofr6DFeZvK5j4SEBNVinMTlcRldItDBIuqBGz1oBMNziBelz/u Bf6jcfKWZht7H9Nlp19X9O8nLpvF1UlAOtAKJuygWX4TSqPNnY6jLCO1qsZ/d7mk5n tDB/RawtoxVzupBFoqLei7/BmWAwVjzo5nh4gUXTpD1ZzG+vHU6uxyL3GHk+cKyDBA MVu3ZBW0xB44gUJ0cAkeY9dNoKCVZAd/aVV0rEXHxeHVhiTqc/3XrsaYFvGGwbYgrj BsI0KyEpP4x5cErkZ9TdHah6RnNVZNt+CvCNJydf9eOtbUiPa/3w63fqWDAJ0NYAAS On4R7yFoqHAdg== From: Arnd Bergmann To: Yury Norov , Jiri Olsa , Song Liu , Alexei Starovoitov Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] buildid: reduce header file dependencies for module Date: Tue, 17 Oct 2023 16:33:58 +0200 Message-Id: <20231017143408.2876181-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 07:34:28 -0700 (PDT) From: Arnd Bergmann The vmlinux decompressor code intentionally has only a limited set of included header files, but this started running into a build failure because of the bitmap logic needing linux/errno.h: In file included from include/linux/cpumask.h:12, from include/linux/mm_types_task.h:14, from include/linux/mm_types.h:5, from include/linux/buildid.h:5, from include/linux/module.h:14, from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39, from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10, from arch/arm/boot/compressed/decompress.c:60: include/linux/bitmap.h: In function 'bitmap_allocate_region': include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function) 527 | return -EBUSY; | ^~~~~ include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in include/linux/bitmap.h: In function 'bitmap_find_free_region': include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function) 554 | return -ENOMEM; | ^~~~~~ This is easily avoided by changing linux/buildid.h to no longer depend on linux/mm_types.h, a header that pulls in a huge number of indirect dependencies. Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h") Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib") Signed-off-by: Arnd Bergmann --- include/linux/buildid.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/buildid.h b/include/linux/buildid.h index 3b7a0ff4642fd..8a582d242f067 100644 --- a/include/linux/buildid.h +++ b/include/linux/buildid.h @@ -2,10 +2,11 @@ #ifndef _LINUX_BUILDID_H #define _LINUX_BUILDID_H -#include +#include #define BUILD_ID_SIZE_MAX 20 +struct vm_area_struct; int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id, __u32 *size); int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size); -- 2.39.2