* [PATCH RESEND] arm: drop unused includes of <linux/personality.h>
@ 2022-02-23 17:36 Sagar Patel
2022-02-25 13:56 ` Will Deacon
0 siblings, 1 reply; 4+ messages in thread
From: Sagar Patel @ 2022-02-23 17:36 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon; +Cc: linux-arm-kernel, Sagar Patel
Drop several includes of <linux/personality.h> which are not used.
git-blame indicates they were used at some point, but they're not needed
anymore.
Signed-off-by: Sagar Patel <sagarmp@cs.unc.edu>
---
arch/arm/mm/mmap.c | 1 -
arch/arm64/include/asm/page.h | 1 -
arch/arm64/kernel/signal.c | 1 -
arch/arm64/kernel/sys_compat.c | 1 -
arch/arm64/kernel/traps.c | 1 -
5 files changed, 5 deletions(-)
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index a0f8a0ca0788..9d831165f628 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -9,7 +9,6 @@
#include <linux/sched/signal.h>
#include <linux/sched/mm.h>
#include <linux/io.h>
-#include <linux/personality.h>
#include <linux/random.h>
#include <asm/cachetype.h>
diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h
index 993a27ea6f54..b5f1a59effee 100644
--- a/arch/arm64/include/asm/page.h
+++ b/arch/arm64/include/asm/page.h
@@ -12,7 +12,6 @@
#ifndef __ASSEMBLY__
-#include <linux/personality.h> /* for READ_IMPLIES_EXEC */
#include <linux/types.h> /* for gfp_t */
#include <asm/pgtable-types.h>
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index d8aaf4b6f432..fe83a42dac8f 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -11,7 +11,6 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/signal.h>
-#include <linux/personality.h>
#include <linux/freezer.h>
#include <linux/stddef.h>
#include <linux/uaccess.h>
diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c
index db5159a3055f..12c6864e51e1 100644
--- a/arch/arm64/kernel/sys_compat.c
+++ b/arch/arm64/kernel/sys_compat.c
@@ -9,7 +9,6 @@
#include <linux/compat.h>
#include <linux/cpufeature.h>
-#include <linux/personality.h>
#include <linux/sched.h>
#include <linux/sched/signal.h>
#include <linux/slab.h>
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 70fc42470f13..bb878f52ca0a 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -9,7 +9,6 @@
#include <linux/bug.h>
#include <linux/context_tracking.h>
#include <linux/signal.h>
-#include <linux/personality.h>
#include <linux/kallsyms.h>
#include <linux/kprobes.h>
#include <linux/spinlock.h>
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] arm: drop unused includes of <linux/personality.h>
2022-02-23 17:36 [PATCH RESEND] arm: drop unused includes of <linux/personality.h> Sagar Patel
@ 2022-02-25 13:56 ` Will Deacon
2022-02-25 19:08 ` Sagar Patel
0 siblings, 1 reply; 4+ messages in thread
From: Will Deacon @ 2022-02-25 13:56 UTC (permalink / raw)
To: Sagar Patel; +Cc: Catalin Marinas, linux-arm-kernel
On Wed, Feb 23, 2022 at 12:36:36PM -0500, Sagar Patel wrote:
> Drop several includes of <linux/personality.h> which are not used.
> git-blame indicates they were used at some point, but they're not needed
> anymore.
>
> Signed-off-by: Sagar Patel <sagarmp@cs.unc.edu>
> ---
> arch/arm/mm/mmap.c | 1 -
> arch/arm64/include/asm/page.h | 1 -
> arch/arm64/kernel/signal.c | 1 -
> arch/arm64/kernel/sys_compat.c | 1 -
> arch/arm64/kernel/traps.c | 1 -
> 5 files changed, 5 deletions(-)
Please can you send separate patches for arch/arm/ and arch/arm64?
Also, how did you determine that these includes are redundant?
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] arm: drop unused includes of <linux/personality.h>
2022-02-25 13:56 ` Will Deacon
@ 2022-02-25 19:08 ` Sagar Patel
2022-03-07 21:36 ` Will Deacon
0 siblings, 1 reply; 4+ messages in thread
From: Sagar Patel @ 2022-02-25 19:08 UTC (permalink / raw)
To: Will Deacon; +Cc: Catalin Marinas, linux-arm-kernel
On Fri, Feb 25, 2022 at 8:56 AM Will Deacon <will@kernel.org> wrote:
>
> On Wed, Feb 23, 2022 at 12:36:36PM -0500, Sagar Patel wrote:
> > Drop several includes of <linux/personality.h> which are not used.
> > git-blame indicates they were used at some point, but they're not needed
> > anymore.
> >
> > Signed-off-by: Sagar Patel <sagarmp@cs.unc.edu>
> > ---
> > arch/arm/mm/mmap.c | 1 -
> > arch/arm64/include/asm/page.h | 1 -
> > arch/arm64/kernel/signal.c | 1 -
> > arch/arm64/kernel/sys_compat.c | 1 -
> > arch/arm64/kernel/traps.c | 1 -
> > 5 files changed, 5 deletions(-)
>
> Please can you send separate patches for arch/arm/ and arch/arm64?
Sure, I can do that.
> Also, how did you determine that these includes are redundant?
Including linux/personality.h only brings in a total of three macros,
and two enums. I manually checked whether any of the included symbols
are used in the changed files.
For arch/arm64/include/asm/page.h (the only changed header file), "not
being used" is not very reassuring. So, I also tested this patch by
building the arm64 kernel with defconfig based on v5.17-rc5.
However, on further investigation, I have found that the macro
VM_DATA_FLAGS_TSK_EXEC (which is used by
arch/arm64/include/asm/page.h) does use personality.h. The build
probably works since another header is pulling in personality.h. How
should this be handled? The right thing to do seems to be to include
personality.h in include/linux/mm.h since that is the header that
defines VM_DATA_FLAGS_TSK_EXEC, and directly uses personality.h.
Should I:
- send the include/linux/mm.h patch to the -mm tree, or
- include the change to include/linux/mm.h in the patches I send you, or
- leave the include in arch/arm64/include/asm/page.h in the patches I
will send you, or
- just send the patches to you separately as-is since it does build?
Thank you (from a first-time kernel contributor),
---Sagar Patel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] arm: drop unused includes of <linux/personality.h>
2022-02-25 19:08 ` Sagar Patel
@ 2022-03-07 21:36 ` Will Deacon
0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2022-03-07 21:36 UTC (permalink / raw)
To: Sagar Patel; +Cc: Catalin Marinas, linux-arm-kernel
On Fri, Feb 25, 2022 at 02:08:16PM -0500, Sagar Patel wrote:
> On Fri, Feb 25, 2022 at 8:56 AM Will Deacon <will@kernel.org> wrote:
> >
> > On Wed, Feb 23, 2022 at 12:36:36PM -0500, Sagar Patel wrote:
> > > Drop several includes of <linux/personality.h> which are not used.
> > > git-blame indicates they were used at some point, but they're not needed
> > > anymore.
> > >
> > > Signed-off-by: Sagar Patel <sagarmp@cs.unc.edu>
> > > ---
> > > arch/arm/mm/mmap.c | 1 -
> > > arch/arm64/include/asm/page.h | 1 -
> > > arch/arm64/kernel/signal.c | 1 -
> > > arch/arm64/kernel/sys_compat.c | 1 -
> > > arch/arm64/kernel/traps.c | 1 -
> > > 5 files changed, 5 deletions(-)
> >
> > Please can you send separate patches for arch/arm/ and arch/arm64?
>
> Sure, I can do that.
>
> > Also, how did you determine that these includes are redundant?
>
> Including linux/personality.h only brings in a total of three macros,
> and two enums. I manually checked whether any of the included symbols
> are used in the changed files.
>
> For arch/arm64/include/asm/page.h (the only changed header file), "not
> being used" is not very reassuring. So, I also tested this patch by
> building the arm64 kernel with defconfig based on v5.17-rc5.
>
> However, on further investigation, I have found that the macro
> VM_DATA_FLAGS_TSK_EXEC (which is used by
> arch/arm64/include/asm/page.h) does use personality.h. The build
> probably works since another header is pulling in personality.h. How
> should this be handled? The right thing to do seems to be to include
> personality.h in include/linux/mm.h since that is the header that
> defines VM_DATA_FLAGS_TSK_EXEC, and directly uses personality.h.
> Should I:
>
> - send the include/linux/mm.h patch to the -mm tree, or
> - include the change to include/linux/mm.h in the patches I send you, or
> - leave the include in arch/arm64/include/asm/page.h in the patches I
> will send you, or
I'd go with this option ^^ for now, and then if you want to tackle the
riskier core change afterwards, please feel free.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-07 21:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-23 17:36 [PATCH RESEND] arm: drop unused includes of <linux/personality.h> Sagar Patel
2022-02-25 13:56 ` Will Deacon
2022-02-25 19:08 ` Sagar Patel
2022-03-07 21:36 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).