Message ID | 20240215145602.1371274-15-max.kellermann@ionos.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-67125-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp454979dyb; Thu, 15 Feb 2024 07:00:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVh35w8ZPrs6HJnqVXxRBAh2BiK46ibKSa91OJ59tS40sr8gyfmyrnz22knDbjmusVdUyqP5Dg66XGGdn+5mRRsp9J6aA== X-Google-Smtp-Source: AGHT+IGLWoOnZ+meVDlxCt2A5kQtEyjdByJBRrBrkMixSRH3NIOuIVw3aUjZ6yWyBf4Vnd1zNjCy X-Received: by 2002:aa7:c645:0:b0:563:8b25:1658 with SMTP id z5-20020aa7c645000000b005638b251658mr1750880edr.19.1708009210894; Thu, 15 Feb 2024 07:00:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708009210; cv=pass; d=google.com; s=arc-20160816; b=GYwPbmaAidvQ746S1bVTYvbRZwTnymSxf9QTWw1k7kt0hVTduPn7nXSCDE9yos6wIh 7xPMwyCcpsur5gCbqnX7/XbcaDs5rFzI+LyhNFAyeCEZFDT/ld3KjBrj9AT8ilQpK3E2 oQJZ9tpmj1JUX0OLAG+F1saIUU8CMRGY/zzm60duRpF7sRB1V0ZIEwZqrxwXDQCpzmPQ 54lseyVLYXDpAdj4OSfKfrZZpqRCH6EU8NwQoQTSKhjVWTqS+HtK+e9vy7qpRRwUcI2j m+SaVPJxi0QB920YHxKOPCChJ7SB/4lsp0QxEVUwn75Pz2ngYuTbWssBUIEsQ69CxRDE Fz9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=k5bNFuP+26n2WAnHi+toNNvLtJ00uY1JoGlCS6SUUmE=; fh=4JIr2CRSGoFo7UcN+zSYPAERMMyhb401V/t63VsrK1U=; b=wntzQOkdnfr0mzZmFHc/cwgQRMIO3zEa6v7aQm3mbNNmIMP5aBIDzRfeN2ElXr6JJF x5Rhvr7HfZupszAj79mEa7HXzFh73mwaVb/GqL6fvrkZOytZ8Kds5AAxfV37nGbHHXOg y1MOZKq0RhAWeZozKfnL0ImhMOf/URgD3U+GiM2wnvOsf89SXO4Vsojd6rhk4gRKJPzm 39oGHaQR17gggf9of56DyaL8Gu//GSaEbHkG8D+ZKn0odbXp9LChO/L1fvbc60flOCXb T9/hu1jyT6MBKfJbc+CmwUB/l/cjs8qa2LSQNHNXy5hn9LUvqiSPZ9UL6iVtUiSH0/UU 1CkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=ZUNiT+mB; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-67125-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67125-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i6-20020aa7c706000000b00560d6e97583si695485edq.226.2024.02.15.07.00.10 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:00:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67125-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=ZUNiT+mB; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-67125-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67125-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4EEFB1F2174B for <ouuuleilei@gmail.com>; Thu, 15 Feb 2024 15:00:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B10301353E9; Thu, 15 Feb 2024 14:56:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="ZUNiT+mB" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37EAE13398A for <linux-kernel@vger.kernel.org>; Thu, 15 Feb 2024 14:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008988; cv=none; b=tr/mTwvY1gokxhcDEPO/htm0JSGmI3HfIXchc2dKBrbwPBqk7ARV92+L/pu2ZGfG1GPM7u8NfzyUL8EtoJIGHVpO+abxPLUwBsaRnWy/AtEQ8GKzejdQ8SPpfVKzYLqyzOoMMDlrrt4B6PIwORGASFRdK/ULSjoQDLfKUM5px9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008988; c=relaxed/simple; bh=99abj94cdBtHWVGTVg4oNZ+VC7s2b8Dvb4V+r0FrVoY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gC4AGqwYMtqzUxUoBJ1SWCGjhiVsEIXaEePfCwkT7oK7XWGHob0Sr6slHnqhhaNi5MW69ML/4FUp2aoaKbtVoQy+TvOJU+5wIXaJM6NjtzyWc1LTo4ZNryww1F+SzjmIvniysDGYUP+Kd18aBtDhBE5momts3orJAQ+LClOC6GQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=ZUNiT+mB; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5116ec49081so1125243e87.2 for <linux-kernel@vger.kernel.org>; Thu, 15 Feb 2024 06:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1708008984; x=1708613784; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k5bNFuP+26n2WAnHi+toNNvLtJ00uY1JoGlCS6SUUmE=; b=ZUNiT+mBSOWniI42pndDtvF09ox6f75QaOJD40J8jpHr4ipe8HrfmKrGrsymVKZjF1 nN0IdTbrAlksw74gDKDlznGuK7M5N0WPZuksSj3qkD24FLY9R4nWg7d7w4GCPFdTdaKQ XmI916qGi+TSRF8yebdVBcPfIhoSHsxBEVvoR5hA8VIacFxIGUsLr/XO5SAHwfSPjMjo 8chq/cLNd1IQ6pzassYtl6NKf7CMGcDpnu0Hu5F+H31Gv3UcxM/Sg3anWou0F7qU4kaw 5EfnwC0eovGJBjVuxjlMVDXlvp2f5l4LMfMk98u/JIcdmj/hHMFJRTunl0jsvTBG8Odn igQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708008984; x=1708613784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k5bNFuP+26n2WAnHi+toNNvLtJ00uY1JoGlCS6SUUmE=; b=eSfpWAaK8JJxsFaTKlkrrMwb6yjwq1qQI7KxtIzrwxvBOiLsxMzdV+Apb1aJ/Smkts KrGelEdMAelgUwuCPDQCzByI4wd6dGKFNqnngvjxb5D6JTBtVraqiwWB8lpcLGxkRO42 g7c3xN/9TaOfCvGvrVG2MX5VnmoEjW+1i8qxHtRJsmN3iaV5VXpjlv9QM7jRYrFJxDe5 UNvyDvwS+ds5p9KT45S59EYqpUIZaqtAQcKBD0o3ZHEc8sCpkUQWogBOr7lnosk37Oce k6hzjzFkGd6yFwRslgZxzY3TNmdgL0gvxQtLbSFURH52ZuoBrGjP0z3g4Fw/OS4GKRs4 BTGQ== X-Forwarded-Encrypted: i=1; AJvYcCXvFWjE6vnFTqyl4dzkoF1GXko5DDIIZH5gNjE7nIF75q2uZAxIQYXWE3luR9jIpXDsGWYfMX1sqsTDuaYdmNI0PRWoUhUvNhehuq7c X-Gm-Message-State: AOJu0YyYWtqaud2095wB0ccdpxrU6Z7KsliHrq6BWmwaATr5W/T20yQm kC+aGnhKn7vwYqLICd+mS1dxwdXTcnhBQLgQ2LbzB+LrSCsF/b90UL93WLfOxCpJJ5t8wj7+CdV P X-Received: by 2002:ac2:58f3:0:b0:511:986e:671e with SMTP id v19-20020ac258f3000000b00511986e671emr1726945lfo.10.1708008984131; Thu, 15 Feb 2024 06:56:24 -0800 (PST) Received: from raven.intern.cm-ag (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id s18-20020a170906169200b00a3d1897ab68sm631175ejd.113.2024.02.15.06.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:56:23 -0800 (PST) From: Max Kellermann <max.kellermann@ionos.com> To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Max Kellermann <max.kellermann@ionos.com> Subject: [PATCH v1 14/14] include: reduce dependencies on linux/mm.h Date: Thu, 15 Feb 2024 15:56:02 +0100 Message-Id: <20240215145602.1371274-15-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215145602.1371274-1-max.kellermann@ionos.com> References: <20240215145602.1371274-1-max.kellermann@ionos.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790977466425994953 X-GMAIL-MSGID: 1790977466425994953 |
Series |
Fast kernel headers: split linux/mm.h
|
|
Commit Message
Max Kellermann
Feb. 15, 2024, 2:56 p.m. UTC
Replace <linux/mm.h> with the smaller pieces that were just splitted
out. This affects a few headers that are included by many, e.g. bio.h
and highmem.h, which now no longer depend on the fat <linux/mm.h>
header.
For this, several missing includes need to be added because they are
no longer indirectly included, e.g. <linux/fs.h>.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
include/linux/bio.h | 2 ++
include/linux/dma-mapping.h | 1 +
include/linux/highmem-internal.h | 2 ++
include/linux/highmem.h | 4 +++-
include/linux/scatterlist.h | 2 +-
include/linux/skbuff.h | 4 ++++
6 files changed, 13 insertions(+), 2 deletions(-)
Comments
Hi Max, kernel test robot noticed the following build errors: [auto build test ERROR on next-20240215] [cannot apply to akpm-mm/mm-everything char-misc/char-misc-testing char-misc/char-misc-next char-misc/char-misc-linus powerpc/next powerpc/fixes linus/master v6.8-rc4 v6.8-rc3 v6.8-rc2 v6.8-rc4] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Max-Kellermann/drivers-add-missing-includes-on-linux-mm-h-and-others/20240215-225853 base: next-20240215 patch link: https://lore.kernel.org/r/20240215145602.1371274-15-max.kellermann%40ionos.com patch subject: [PATCH v1 14/14] include: reduce dependencies on linux/mm.h config: nios2-allnoconfig (https://download.01.org/0day-ci/archive/20240217/202402172345.crcmOhf2-lkp@intel.com/config) compiler: nios2-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240217/202402172345.crcmOhf2-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202402172345.crcmOhf2-lkp@intel.com/ All error/warnings (new ones prefixed by >>): lib/scatterlist.c: In function 'sg_page_count': >> lib/scatterlist.c:739:16: error: implicit declaration of function 'PAGE_ALIGN'; did you mean 'PTR_ALIGN'? [-Werror=implicit-function-declaration] 739 | return PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT; | ^~~~~~~~~~ | PTR_ALIGN lib/scatterlist.c: In function 'extract_user_to_sg': >> lib/scatterlist.c:1153:17: error: implicit declaration of function 'unpin_user_page'; did you mean 'copy_user_page'? [-Werror=implicit-function-declaration] 1153 | unpin_user_page(sg_page(&sgtable->sgl[--sgtable->nents])); | ^~~~~~~~~~~~~~~ | copy_user_page lib/scatterlist.c: In function 'extract_kvec_to_sg': >> lib/scatterlist.c:1239:29: error: implicit declaration of function 'is_vmalloc_or_module_addr' [-Werror=implicit-function-declaration] 1239 | if (is_vmalloc_or_module_addr((void *)kaddr)) | ^~~~~~~~~~~~~~~~~~~~~~~~~ >> lib/scatterlist.c:1240:40: error: implicit declaration of function 'vmalloc_to_page'; did you mean 'vmalloc_nr_pages'? [-Werror=implicit-function-declaration] 1240 | page = vmalloc_to_page((void *)kaddr); | ^~~~~~~~~~~~~~~ | vmalloc_nr_pages >> lib/scatterlist.c:1240:38: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1240 | page = vmalloc_to_page((void *)kaddr); | ^ cc1: some warnings being treated as errors -- In file included from include/linux/mm_inline.h:6, from mm/mmu_gather.c:6: >> include/linux/huge_mm.h:12:19: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 12 | pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, | ^~~~~ | pgd_t include/linux/huge_mm.h:12:35: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 12 | pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, | ^~~~~ | pgd_t >> include/linux/huge_mm.h:16:19: error: unknown type name 'pud_t'; did you mean 'pgd_t'? 16 | pud_t *dst_pud, pud_t *src_pud, unsigned long addr, | ^~~~~ | pgd_t include/linux/huge_mm.h:16:35: error: unknown type name 'pud_t'; did you mean 'pgd_t'? 16 | pud_t *dst_pud, pud_t *src_pud, unsigned long addr, | ^~~~~ | pgd_t include/linux/huge_mm.h:22:64: error: unknown type name 'pud_t'; did you mean 'pgd_t'? 22 | static inline void huge_pud_set_accessed(struct vm_fault *vmf, pud_t orig_pud) | ^~~~~ | pgd_t include/linux/huge_mm.h:29:28: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 29 | pmd_t *pmd, unsigned long addr, unsigned long next); | ^~~~~ | pgd_t include/linux/huge_mm.h:30:70: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 30 | int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, pmd_t *pmd, | ^~~~~ | pgd_t include/linux/huge_mm.h:32:70: error: unknown type name 'pud_t'; did you mean 'pgd_t'? 32 | int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma, pud_t *pud, | ^~~~~ | pgd_t include/linux/huge_mm.h:35:44: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 35 | unsigned long new_addr, pmd_t *old_pmd, pmd_t *new_pmd); | ^~~~~ | pgd_t include/linux/huge_mm.h:35:60: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 35 | unsigned long new_addr, pmd_t *old_pmd, pmd_t *new_pmd); | ^~~~~ | pgd_t include/linux/huge_mm.h:37:21: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 37 | pmd_t *pmd, unsigned long addr, pgprot_t newprot, | ^~~~~ | pgd_t include/linux/huge_mm.h:437:65: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 437 | static inline void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | ^~~~~ | pgd_t include/linux/huge_mm.h:464:31: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 464 | static inline int is_swap_pmd(pmd_t pmd) | ^~~~~ | pgd_t include/linux/huge_mm.h:468:47: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 468 | static inline spinlock_t *pmd_trans_huge_lock(pmd_t *pmd, | ^~~~~ | pgd_t include/linux/huge_mm.h:473:47: error: unknown type name 'pud_t'; did you mean 'pgd_t'? 473 | static inline spinlock_t *pud_trans_huge_lock(pud_t *pud, | ^~~~~ | pgd_t include/linux/huge_mm.h:489:37: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 489 | static inline bool is_huge_zero_pmd(pmd_t pmd) | ^~~~~ | pgd_t include/linux/huge_mm.h:494:37: error: unknown type name 'pud_t'; did you mean 'pgd_t'? 494 | static inline bool is_huge_zero_pud(pud_t pud) | ^~~~~ | pgd_t include/linux/huge_mm.h:505:29: error: unknown type name 'pmd_t'; did you mean 'pgd_t'? 505 | unsigned long addr, pmd_t *pmd, int flags, struct dev_pagemap **pgmap) | ^~~~~ | pgd_t include/linux/huge_mm.h:511:29: error: unknown type name 'pud_t'; did you mean 'pgd_t'? 511 | unsigned long addr, pud_t *pud, int flags, struct dev_pagemap **pgmap) | ^~~~~ | pgd_t vim +739 lib/scatterlist.c a321e91b6d73ed Imre Deak 2013-02-27 736 a321e91b6d73ed Imre Deak 2013-02-27 737 static int sg_page_count(struct scatterlist *sg) a321e91b6d73ed Imre Deak 2013-02-27 738 { a321e91b6d73ed Imre Deak 2013-02-27 @739 return PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT; a321e91b6d73ed Imre Deak 2013-02-27 740 } a321e91b6d73ed Imre Deak 2013-02-27 741
Hi Max, kernel test robot noticed the following build errors: [auto build test ERROR on next-20240215] [cannot apply to akpm-mm/mm-everything char-misc/char-misc-testing char-misc/char-misc-next char-misc/char-misc-linus powerpc/next powerpc/fixes linus/master v6.8-rc4 v6.8-rc3 v6.8-rc2 v6.8-rc4] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Max-Kellermann/drivers-add-missing-includes-on-linux-mm-h-and-others/20240215-225853 base: next-20240215 patch link: https://lore.kernel.org/r/20240215145602.1371274-15-max.kellermann%40ionos.com patch subject: [PATCH v1 14/14] include: reduce dependencies on linux/mm.h config: hexagon-allnoconfig (https://download.01.org/0day-ci/archive/20240218/202402180115.xH2WHdhd-lkp@intel.com/config) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 36adfec155de366d722f2bac8ff9162289dcf06c) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240218/202402180115.xH2WHdhd-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202402180115.xH2WHdhd-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from lib/scatterlist.c:9: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 547 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ^ In file included from lib/scatterlist.c:9: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ In file included from lib/scatterlist.c:9: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:328: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 584 | __raw_writeb(value, PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ >> lib/scatterlist.c:739:9: error: call to undeclared function 'PAGE_ALIGN'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 739 | return PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT; | ^ lib/scatterlist.c:763:9: error: call to undeclared function 'PAGE_ALIGN'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 763 | return PAGE_ALIGN(sg->offset + sg_dma_len(sg)) >> PAGE_SHIFT; | ^ >> lib/scatterlist.c:1153:3: error: call to undeclared function 'unpin_user_page'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1153 | unpin_user_page(sg_page(&sgtable->sgl[--sgtable->nents])); | ^ >> lib/scatterlist.c:1239:8: error: call to undeclared function 'is_vmalloc_or_module_addr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1239 | if (is_vmalloc_or_module_addr((void *)kaddr)) | ^ >> lib/scatterlist.c:1240:12: error: call to undeclared function 'vmalloc_to_page'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1240 | page = vmalloc_to_page((void *)kaddr); | ^ lib/scatterlist.c:1240:12: note: did you mean 'vmalloc_nr_pages'? include/linux/vmalloc.h:135:22: note: 'vmalloc_nr_pages' declared here 135 | extern unsigned long vmalloc_nr_pages(void); | ^ >> lib/scatterlist.c:1240:10: error: incompatible integer to pointer conversion assigning to 'struct page *' from 'int' [-Wint-conversion] 1240 | page = vmalloc_to_page((void *)kaddr); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 warnings and 6 errors generated. vim +/PAGE_ALIGN +739 lib/scatterlist.c a321e91b6d73ed Imre Deak 2013-02-27 736 a321e91b6d73ed Imre Deak 2013-02-27 737 static int sg_page_count(struct scatterlist *sg) a321e91b6d73ed Imre Deak 2013-02-27 738 { a321e91b6d73ed Imre Deak 2013-02-27 @739 return PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT; a321e91b6d73ed Imre Deak 2013-02-27 740 } a321e91b6d73ed Imre Deak 2013-02-27 741
Hi Max, kernel test robot noticed the following build warnings: [auto build test WARNING on next-20240215] [cannot apply to akpm-mm/mm-everything char-misc/char-misc-testing char-misc/char-misc-next char-misc/char-misc-linus powerpc/next powerpc/fixes linus/master v6.8-rc4 v6.8-rc3 v6.8-rc2 v6.8-rc4] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Max-Kellermann/drivers-add-missing-includes-on-linux-mm-h-and-others/20240215-225853 base: next-20240215 patch link: https://lore.kernel.org/r/20240215145602.1371274-15-max.kellermann%40ionos.com patch subject: [PATCH v1 14/14] include: reduce dependencies on linux/mm.h config: um-allyesconfig (https://download.01.org/0day-ci/archive/20240218/202402180247.nziZ7rAH-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240218/202402180247.nziZ7rAH-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202402180247.nziZ7rAH-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from include/linux/kfifo.h:42, from include/linux/tty_port.h:5, from include/linux/tty.h:12, from lib/bust_spinlocks.c:15: include/linux/scatterlist.h: In function 'sg_set_buf': include/linux/scatterlist.h:189:25: error: implicit declaration of function 'virt_to_page'; did you mean 'virt_to_phys'? [-Werror=implicit-function-declaration] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~ | virt_to_phys >> include/linux/scatterlist.h:189:25: warning: passing argument 2 of 'sg_set_page' makes pointer from integer without a cast [-Wint-conversion] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~~~~~~ | | | int include/linux/scatterlist.h:136:69: note: expected 'struct page *' but argument is of type 'int' 136 | static inline void sg_set_page(struct scatterlist *sg, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/scatterlist.h: In function 'sg_phys': include/linux/scatterlist.h:389:16: error: implicit declaration of function 'page_to_phys'; did you mean 'page_to_pfn'? [-Werror=implicit-function-declaration] 389 | return page_to_phys(sg_page(sg)) + sg->offset; | ^~~~~~~~~~~~ | page_to_pfn cc1: some warnings being treated as errors -- In file included from include/linux/kfifo.h:42, from lib/kfifo.c:14: include/linux/scatterlist.h: In function 'sg_set_buf': include/linux/scatterlist.h:189:25: error: implicit declaration of function 'virt_to_page'; did you mean 'virt_to_phys'? [-Werror=implicit-function-declaration] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~ | virt_to_phys >> include/linux/scatterlist.h:189:25: warning: passing argument 2 of 'sg_set_page' makes pointer from integer without a cast [-Wint-conversion] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~~~~~~ | | | int include/linux/scatterlist.h:136:69: note: expected 'struct page *' but argument is of type 'int' 136 | static inline void sg_set_page(struct scatterlist *sg, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/scatterlist.h: In function 'sg_phys': include/linux/scatterlist.h:389:16: error: implicit declaration of function 'page_to_phys'; did you mean 'page_to_pfn'? [-Werror=implicit-function-declaration] 389 | return page_to_phys(sg_page(sg)) + sg->offset; | ^~~~~~~~~~~~ | page_to_pfn lib/kfifo.c: In function 'setup_sgl_buf': >> lib/kfifo.c:310:14: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 310 | page = virt_to_page(buf); | ^ lib/kfifo.c:319:23: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 319 | npage = virt_to_page(buf); | ^ cc1: some warnings being treated as errors -- In file included from include/linux/dmapool.h:14, from include/linux/pci.h:1654, from lib/iomap.c:7: include/linux/scatterlist.h: In function 'sg_set_buf': include/linux/scatterlist.h:189:25: error: implicit declaration of function 'virt_to_page'; did you mean 'virt_to_phys'? [-Werror=implicit-function-declaration] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~ | virt_to_phys >> include/linux/scatterlist.h:189:25: warning: passing argument 2 of 'sg_set_page' makes pointer from integer without a cast [-Wint-conversion] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~~~~~~ | | | int include/linux/scatterlist.h:136:69: note: expected 'struct page *' but argument is of type 'int' 136 | static inline void sg_set_page(struct scatterlist *sg, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/scatterlist.h: In function 'sg_phys': include/linux/scatterlist.h:389:16: error: implicit declaration of function 'page_to_phys'; did you mean 'page_to_pfn'? [-Werror=implicit-function-declaration] 389 | return page_to_phys(sg_page(sg)) + sg->offset; | ^~~~~~~~~~~~ | page_to_pfn In file included from include/linux/pci.h:2688: include/linux/dma-mapping.h: In function 'dma_free_noncoherent': >> include/linux/dma-mapping.h:331:35: warning: passing argument 3 of 'dma_free_pages' makes pointer from integer without a cast [-Wint-conversion] 331 | dma_free_pages(dev, size, virt_to_page(vaddr), dma_handle, dir); | ^~~~~~~~~~~~~~~~~~~ | | | int include/linux/dma-mapping.h:316:67: note: expected 'struct page *' but argument is of type 'int' 316 | void dma_free_pages(struct device *dev, size_t size, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/dma-mapping.h: In function 'dma_map_single_attrs': >> include/linux/dma-mapping.h:342:40: warning: passing argument 2 of 'dma_map_page_attrs' makes pointer from integer without a cast [-Wint-conversion] 342 | return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr), | ^~~~~~~~~~~~~~~~~ | | | int include/linux/dma-mapping.h:105:64: note: expected 'struct page *' but argument is of type 'int' 105 | dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page, | ~~~~~~~~~~~~~^~~~ lib/iomap.c: At top level: lib/iomap.c:156:5: warning: no previous prototype for 'ioread64_lo_hi' [-Wmissing-prototypes] 156 | u64 ioread64_lo_hi(const void __iomem *addr) | ^~~~~~~~~~~~~~ lib/iomap.c:163:5: warning: no previous prototype for 'ioread64_hi_lo' [-Wmissing-prototypes] 163 | u64 ioread64_hi_lo(const void __iomem *addr) | ^~~~~~~~~~~~~~ lib/iomap.c:170:5: warning: no previous prototype for 'ioread64be_lo_hi' [-Wmissing-prototypes] 170 | u64 ioread64be_lo_hi(const void __iomem *addr) | ^~~~~~~~~~~~~~~~ lib/iomap.c:178:5: warning: no previous prototype for 'ioread64be_hi_lo' [-Wmissing-prototypes] 178 | u64 ioread64be_hi_lo(const void __iomem *addr) | ^~~~~~~~~~~~~~~~ lib/iomap.c:264:6: warning: no previous prototype for 'iowrite64_lo_hi' [-Wmissing-prototypes] 264 | void iowrite64_lo_hi(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~ lib/iomap.c:272:6: warning: no previous prototype for 'iowrite64_hi_lo' [-Wmissing-prototypes] 272 | void iowrite64_hi_lo(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~ lib/iomap.c:280:6: warning: no previous prototype for 'iowrite64be_lo_hi' [-Wmissing-prototypes] 280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~~~ lib/iomap.c:288:6: warning: no previous prototype for 'iowrite64be_hi_lo' [-Wmissing-prototypes] 288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr) | ^~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- In file included from include/linux/virtio.h:7, from arch/um/drivers/virtio_uml.c:27: include/linux/scatterlist.h: In function 'sg_set_buf': include/linux/scatterlist.h:189:25: error: implicit declaration of function 'virt_to_page'; did you mean 'virt_to_phys'? [-Werror=implicit-function-declaration] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~ | virt_to_phys >> include/linux/scatterlist.h:189:25: warning: passing argument 2 of 'sg_set_page' makes pointer from integer without a cast [-Wint-conversion] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~~~~~~ | | | int include/linux/scatterlist.h:136:69: note: expected 'struct page *' but argument is of type 'int' 136 | static inline void sg_set_page(struct scatterlist *sg, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/scatterlist.h: In function 'sg_phys': include/linux/scatterlist.h:389:16: error: implicit declaration of function 'page_to_phys'; did you mean 'page_to_pfn'? [-Werror=implicit-function-declaration] 389 | return page_to_phys(sg_page(sg)) + sg->offset; | ^~~~~~~~~~~~ | page_to_pfn In file included from include/linux/virtio.h:12: include/linux/dma-mapping.h: In function 'dma_free_noncoherent': >> include/linux/dma-mapping.h:331:35: warning: passing argument 3 of 'dma_free_pages' makes pointer from integer without a cast [-Wint-conversion] 331 | dma_free_pages(dev, size, virt_to_page(vaddr), dma_handle, dir); | ^~~~~~~~~~~~~~~~~~~ | | | int include/linux/dma-mapping.h:316:67: note: expected 'struct page *' but argument is of type 'int' 316 | void dma_free_pages(struct device *dev, size_t size, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/dma-mapping.h: In function 'dma_map_single_attrs': >> include/linux/dma-mapping.h:342:40: warning: passing argument 2 of 'dma_map_page_attrs' makes pointer from integer without a cast [-Wint-conversion] 342 | return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr), | ^~~~~~~~~~~~~~~~~ | | | int include/linux/dma-mapping.h:105:64: note: expected 'struct page *' but argument is of type 'int' 105 | dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page, | ~~~~~~~~~~~~~^~~~ In file included from arch/um/include/asm/thread_info.h:15, from include/linux/thread_info.h:60, from include/asm-generic/preempt.h:5, from ./arch/um/include/generated/asm/preempt.h:1, from include/linux/preempt.h:79, from include/linux/spinlock.h:56, from include/linux/mmzone.h:8, from include/linux/gfp.h:7, from include/linux/umh.h:4, from include/linux/kmod.h:9, from include/linux/module.h:17, from arch/um/drivers/virtio_uml.c:23: arch/um/drivers/virtio_uml.c: In function 'vhost_user_set_mem_table': arch/um/drivers/virtio_uml.c:678:54: error: 'end_iomem' undeclared (first use in this function) 678 | rc = vhost_user_init_mem_region(__pa(end_iomem), highmem, | ^~~~~~~~~ arch/um/include/asm/page.h:105:58: note: in definition of macro '__pa' 105 | #define __pa(virt) uml_to_phys((void *) (unsigned long) (virt)) | ^~~~ arch/um/drivers/virtio_uml.c:678:54: note: each undeclared identifier is reported only once for each function it appears in 678 | rc = vhost_user_init_mem_region(__pa(end_iomem), highmem, | ^~~~~~~~~ arch/um/include/asm/page.h:105:58: note: in definition of macro '__pa' 105 | #define __pa(virt) uml_to_phys((void *) (unsigned long) (virt)) | ^~~~ cc1: some warnings being treated as errors -- In file included from include/linux/dmapool.h:14, from include/linux/pci.h:1654, from arch/um/drivers/virt-pci.c:7: include/linux/scatterlist.h: In function 'sg_set_buf': include/linux/scatterlist.h:189:25: error: implicit declaration of function 'virt_to_page'; did you mean 'virt_to_phys'? [-Werror=implicit-function-declaration] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~ | virt_to_phys >> include/linux/scatterlist.h:189:25: warning: passing argument 2 of 'sg_set_page' makes pointer from integer without a cast [-Wint-conversion] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~~~~~~ | | | int include/linux/scatterlist.h:136:69: note: expected 'struct page *' but argument is of type 'int' 136 | static inline void sg_set_page(struct scatterlist *sg, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/scatterlist.h: In function 'sg_phys': include/linux/scatterlist.h:389:16: error: implicit declaration of function 'page_to_phys'; did you mean 'page_to_pfn'? [-Werror=implicit-function-declaration] 389 | return page_to_phys(sg_page(sg)) + sg->offset; | ^~~~~~~~~~~~ | page_to_pfn In file included from include/linux/pci.h:2688: include/linux/dma-mapping.h: In function 'dma_free_noncoherent': >> include/linux/dma-mapping.h:331:35: warning: passing argument 3 of 'dma_free_pages' makes pointer from integer without a cast [-Wint-conversion] 331 | dma_free_pages(dev, size, virt_to_page(vaddr), dma_handle, dir); | ^~~~~~~~~~~~~~~~~~~ | | | int include/linux/dma-mapping.h:316:67: note: expected 'struct page *' but argument is of type 'int' 316 | void dma_free_pages(struct device *dev, size_t size, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/dma-mapping.h: In function 'dma_map_single_attrs': >> include/linux/dma-mapping.h:342:40: warning: passing argument 2 of 'dma_map_page_attrs' makes pointer from integer without a cast [-Wint-conversion] 342 | return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr), | ^~~~~~~~~~~~~~~~~ | | | int include/linux/dma-mapping.h:105:64: note: expected 'struct page *' but argument is of type 'int' 105 | dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page, | ~~~~~~~~~~~~~^~~~ cc1: some warnings being treated as errors -- In file included from include/linux/dma-mapping.h:11, from include/linux/comedi/comedidev.h:13, from drivers/comedi/comedi_buf.c:12: include/linux/scatterlist.h: In function 'sg_set_buf': include/linux/scatterlist.h:189:25: error: implicit declaration of function 'virt_to_page'; did you mean 'virt_to_phys'? [-Werror=implicit-function-declaration] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~ | virt_to_phys >> include/linux/scatterlist.h:189:25: warning: passing argument 2 of 'sg_set_page' makes pointer from integer without a cast [-Wint-conversion] 189 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | ^~~~~~~~~~~~~~~~~ | | | int include/linux/scatterlist.h:136:69: note: expected 'struct page *' but argument is of type 'int' 136 | static inline void sg_set_page(struct scatterlist *sg, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/scatterlist.h: In function 'sg_phys': include/linux/scatterlist.h:389:16: error: implicit declaration of function 'page_to_phys'; did you mean 'page_to_pfn'? [-Werror=implicit-function-declaration] 389 | return page_to_phys(sg_page(sg)) + sg->offset; | ^~~~~~~~~~~~ | page_to_pfn include/linux/dma-mapping.h: In function 'dma_free_noncoherent': >> include/linux/dma-mapping.h:331:35: warning: passing argument 3 of 'dma_free_pages' makes pointer from integer without a cast [-Wint-conversion] 331 | dma_free_pages(dev, size, virt_to_page(vaddr), dma_handle, dir); | ^~~~~~~~~~~~~~~~~~~ | | | int include/linux/dma-mapping.h:316:67: note: expected 'struct page *' but argument is of type 'int' 316 | void dma_free_pages(struct device *dev, size_t size, struct page *page, | ~~~~~~~~~~~~~^~~~ include/linux/dma-mapping.h: In function 'dma_map_single_attrs': >> include/linux/dma-mapping.h:342:40: warning: passing argument 2 of 'dma_map_page_attrs' makes pointer from integer without a cast [-Wint-conversion] 342 | return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr), | ^~~~~~~~~~~~~~~~~ | | | int include/linux/dma-mapping.h:105:64: note: expected 'struct page *' but argument is of type 'int' 105 | dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page, | ~~~~~~~~~~~~~^~~~ drivers/comedi/comedi_buf.c: In function 'comedi_buf_map_kref_release': >> drivers/comedi/comedi_buf.c:41:51: warning: passing argument 1 of 'ClearPageReserved' makes pointer from integer without a cast [-Wint-conversion] 41 | ClearPageReserved(virt_to_page(buf->virt_addr)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int In file included from include/linux/mmzone.h:23, from include/linux/gfp.h:7, from include/linux/slab.h:16, from drivers/comedi/comedi_buf.c:11: include/linux/page-flags.h:390:59: note: expected 'struct page *' but argument is of type 'int' 390 | static __always_inline void ClearPage##uname(struct page *page) \ | ~~~~~~~~~~~~~^~~~ include/linux/page-flags.h:424:9: note: in expansion of macro 'CLEARPAGEFLAG' 424 | CLEARPAGEFLAG(uname, lname, policy) | ^~~~~~~~~~~~~ include/linux/page-flags.h:492:1: note: in expansion of macro 'PAGEFLAG' 492 | PAGEFLAG(Reserved, reserved, PF_NO_COMPOUND) | ^~~~~~~~ drivers/comedi/comedi_buf.c: In function 'comedi_buf_map_alloc': >> drivers/comedi/comedi_buf.c:124:41: warning: passing argument 1 of 'SetPageReserved' makes pointer from integer without a cast [-Wint-conversion] 124 | SetPageReserved(virt_to_page(buf->virt_addr)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/linux/page-flags.h:383:57: note: expected 'struct page *' but argument is of type 'int' 383 | static __always_inline void SetPage##uname(struct page *page) \ | ~~~~~~~~~~~~~^~~~ include/linux/page-flags.h:423:9: note: in expansion of macro 'SETPAGEFLAG' 423 | SETPAGEFLAG(uname, lname, policy) \ | ^~~~~~~~~~~ include/linux/page-flags.h:492:1: note: in expansion of macro 'PAGEFLAG' 492 | PAGEFLAG(Reserved, reserved, PF_NO_COMPOUND) | ^~~~~~~~ drivers/comedi/comedi_buf.c: In function '__comedi_buf_alloc': >> drivers/comedi/comedi_buf.c:178:34: warning: assignment to 'struct page *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 178 | pages[i] = virt_to_page(buf->virt_addr); | ^ drivers/comedi/comedi_buf.c:18:41: error: 'PAGE_KERNEL' undeclared (first use in this function) 18 | #define COMEDI_PAGE_PROTECTION PAGE_KERNEL | ^~~~~~~~~~~ drivers/comedi/comedi_buf.c:183:44: note: in expansion of macro 'COMEDI_PAGE_PROTECTION' 183 | COMEDI_PAGE_PROTECTION); | ^~~~~~~~~~~~~~~~~~~~~~ drivers/comedi/comedi_buf.c:18:41: note: each undeclared identifier is reported only once for each function it appears in 18 | #define COMEDI_PAGE_PROTECTION PAGE_KERNEL | ^~~~~~~~~~~ drivers/comedi/comedi_buf.c:183:44: note: in expansion of macro 'COMEDI_PAGE_PROTECTION' 183 | COMEDI_PAGE_PROTECTION); | ^~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors . vim +/sg_set_page +189 include/linux/scatterlist.h 82f66fbef58de4 Jens Axboe 2007-10-22 175 18dabf473e1585 Jens Axboe 2007-10-22 176 /** 18dabf473e1585 Jens Axboe 2007-10-22 177 * sg_set_buf - Set sg entry to point at given data 18dabf473e1585 Jens Axboe 2007-10-22 178 * @sg: SG entry 18dabf473e1585 Jens Axboe 2007-10-22 179 * @buf: Data 18dabf473e1585 Jens Axboe 2007-10-22 180 * @buflen: Data length 18dabf473e1585 Jens Axboe 2007-10-22 181 * 18dabf473e1585 Jens Axboe 2007-10-22 182 **/ 82f66fbef58de4 Jens Axboe 2007-10-22 183 static inline void sg_set_buf(struct scatterlist *sg, const void *buf, d32311fed70d12 Herbert Xu 2005-09-17 184 unsigned int buflen) d32311fed70d12 Herbert Xu 2005-09-17 185 { ac4e97abce9b80 Rusty Russell 2013-05-30 186 #ifdef CONFIG_DEBUG_SG ac4e97abce9b80 Rusty Russell 2013-05-30 187 BUG_ON(!virt_addr_valid(buf)); ac4e97abce9b80 Rusty Russell 2013-05-30 188 #endif 642f149031d704 Jens Axboe 2007-10-24 @189 sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); d32311fed70d12 Herbert Xu 2005-09-17 190 } d32311fed70d12 Herbert Xu 2005-09-17 191
diff --git a/include/linux/bio.h b/include/linux/bio.h index 875d792bffff..e2f24d7235d3 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -5,7 +5,9 @@ #ifndef __LINUX_BIO_H #define __LINUX_BIO_H +#include <linux/fs.h> // for struct kiocb, IOCB_NOWAIT #include <linux/mempool.h> +#include <linux/mm/folio_next.h> /* struct bio, bio_vec and BIO_* flags are defined in blk_types.h */ #include <linux/blk_types.h> #include <linux/uio.h> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 4a658de44ee9..37d5591039c7 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -11,6 +11,7 @@ #include <linux/scatterlist.h> #include <linux/bug.h> #include <linux/mem_encrypt.h> +#include <linux/mm/vmalloc_addr.h> /** * List of possible attributes associated with a DMA mapping. The semantics diff --git a/include/linux/highmem-internal.h b/include/linux/highmem-internal.h index a3028e400a9c..a479e6b7c54c 100644 --- a/include/linux/highmem-internal.h +++ b/include/linux/highmem-internal.h @@ -2,6 +2,8 @@ #ifndef _LINUX_HIGHMEM_INTERNAL_H #define _LINUX_HIGHMEM_INTERNAL_H +#include <linux/mm/page_address.h> + /* * Outside of CONFIG_HIGHMEM to support X86 32bit iomap_atomic() cruft. */ diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 00341b56d291..b9dd5dd915c3 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -7,7 +7,9 @@ #include <linux/bug.h> #include <linux/cacheflush.h> #include <linux/kmsan.h> -#include <linux/mm.h> +#include <linux/mm/page_address.h> +#include <linux/mm/page_size.h> +#include <linux/mm/page_usage.h> // for folio_put() #include <linux/uaccess.h> #include <linux/hardirq.h> diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 77df3d7b18a6..d55cfcde1b09 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -5,7 +5,7 @@ #include <linux/string.h> #include <linux/types.h> #include <linux/bug.h> -#include <linux/mm.h> +#include <linux/mm/page_address.h> #include <asm/io.h> struct scatterlist { diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 696e7680656f..5bd89f0f7e7e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -16,6 +16,10 @@ #include <linux/bug.h> #include <linux/bvec.h> #include <linux/cache.h> +#include <linux/gfp.h> // for alloc_pages_node() +#include <linux/mm/page_usage.h> // for get_page(), put_page() +#include <linux/mm/page_zone.h> // for page_to_nid() +#include <linux/mm/pfmemalloc.h> // for page_is_pfmemalloc() #include <linux/rbtree.h> #include <linux/socket.h> #include <linux/refcount.h>