From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH 2/4] Makefile: remove some unnecessary header include paths
Date: Tue, 16 Apr 2024 21:18:36 +0900 [thread overview]
Message-ID: <20240416121838.95427-3-masahiroy@kernel.org> (raw)
In-Reply-To: <20240416121838.95427-1-masahiroy@kernel.org>
The include directive with the double-quote form, #include "...",
first searches for the specified header in the directory containing
the source file.
If all local headers are included using the double-quote form instead
of the angle bracket form, there is no need to add the local directory
to the header search path.
drivers/gpu/drm/imagination and drivers/net/ethernet/aquantia/atlantic
use only the double-quote form for including the local headers, and
there are no generated sources or headers in their directories. Hence,
the local header search path is unneeded.
The same applies to arch/loongarch/kvm/ because TRACE_INCLUDE_PATH is
relative to include/trace/.
I guess there exist more Makefiles with unnecessary header inclusion
paths (and more cases where it is possible to delete the header search
path by replacing #include <...> with #include "..."), but I do not have
an easy way to detect it.
These are unneeded inclusion paths that I happened to find.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/loongarch/kvm/Makefile | 2 --
drivers/gpu/drm/imagination/Makefile | 2 --
drivers/net/ethernet/aquantia/atlantic/Makefile | 2 --
3 files changed, 6 deletions(-)
diff --git a/arch/loongarch/kvm/Makefile b/arch/loongarch/kvm/Makefile
index 244467d7792a..7a0108a721c1 100644
--- a/arch/loongarch/kvm/Makefile
+++ b/arch/loongarch/kvm/Makefile
@@ -3,8 +3,6 @@
# Makefile for LoongArch KVM support
#
-ccflags-y += -I $(srctree)/$(src)
-
include $(srctree)/virt/kvm/Makefile.kvm
obj-$(CONFIG_KVM) += kvm.o
diff --git a/drivers/gpu/drm/imagination/Makefile b/drivers/gpu/drm/imagination/Makefile
index ec6db8e9b403..3d9d4d40fb80 100644
--- a/drivers/gpu/drm/imagination/Makefile
+++ b/drivers/gpu/drm/imagination/Makefile
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only OR MIT
# Copyright (c) 2023 Imagination Technologies Ltd.
-subdir-ccflags-y := -I$(srctree)/$(src)
-
powervr-y := \
pvr_ccb.o \
pvr_cccb.o \
diff --git a/drivers/net/ethernet/aquantia/atlantic/Makefile b/drivers/net/ethernet/aquantia/atlantic/Makefile
index 8ebcc68e807f..268a055086c4 100644
--- a/drivers/net/ethernet/aquantia/atlantic/Makefile
+++ b/drivers/net/ethernet/aquantia/atlantic/Makefile
@@ -8,8 +8,6 @@
obj-$(CONFIG_AQTION) += atlantic.o
-ccflags-y += -I$(srctree)/$(src)
-
atlantic-objs := aq_main.o \
aq_nic.o \
aq_pci_func.o \
--
2.40.1
next prev parent reply other threads:[~2024-04-16 12:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 12:18 [PATCH 0/4] kbuild: replace $(srctree)/$(src) with $(src) in Makefiles Masahiro Yamada
2024-04-16 12:18 ` [PATCH 1/4] arch: use $(obj)/ instead of $(src)/ for preprocessed linker scripts Masahiro Yamada
2024-04-19 14:59 ` Nicolas Schier
2024-04-16 12:18 ` Masahiro Yamada [this message]
2024-04-19 15:07 ` [PATCH 2/4] Makefile: remove some unnecessary header include paths Nicolas Schier
2024-04-20 7:46 ` Masahiro Yamada
2024-04-16 12:18 ` [PATCH 3/4] kbuild: use $(obj)/ instead of $(src)/ for pattern rules for %.[cS] Masahiro Yamada
2024-04-19 15:09 ` Nicolas Schier
2024-04-16 12:18 ` [PATCH 4/4] kbuild: use $(src) instead of $(srctree)/$(src) for source directory Masahiro Yamada
2024-04-16 22:45 ` kernel test robot
2024-04-17 4:19 ` kernel test robot
2024-04-18 13:43 ` Rob Herring
2024-04-19 15:09 ` Nicolas Schier
2024-04-20 8:56 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240416121838.95427-3-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox