2021-04-11 08:19:10

by Jan Kiszka

[permalink] [raw]
Subject: [PATCH] x86: Ensure asm/proto.h can be included stand-alone

From: Jan Kiszka <[email protected]>

Avoids

../arch/x86/include/asm/proto.h:14:30: warning: ‘struct task_struct’ declared inside parameter list will not be visible outside of this definition or declaration
long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2);
^~~~~~~~~~~
../arch/x86/include/asm/proto.h:40:34: warning: ‘struct task_struct’ declared inside parameter list will not be visible outside of this definition or declaration
long do_arch_prctl_common(struct task_struct *task, int option,
^~~~~~~~~~~

if linux/sched.h hasn't be included previously.

Signed-off-by: Jan Kiszka <[email protected]>
---
arch/x86/include/asm/proto.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index b6a9d51d1d79..8c5d1910a848 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -4,6 +4,8 @@

#include <asm/ldt.h>

+struct task_struct;
+
/* misc architecture specific prototypes */

void syscall_init(void);
--
2.26.2


2021-04-13 00:35:49

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: x86/cleanups] x86/asm: Ensure asm/proto.h can be included stand-alone

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID: f7b21a0e41171d22296b897dac6e4c41d2a3643c
Gitweb: https://git.kernel.org/tip/f7b21a0e41171d22296b897dac6e4c41d2a3643c
Author: Jan Kiszka <[email protected]>
AuthorDate: Sun, 11 Apr 2021 10:12:16 +02:00
Committer: Borislav Petkov <[email protected]>
CommitterDate: Mon, 12 Apr 2021 13:12:46 +02:00

x86/asm: Ensure asm/proto.h can be included stand-alone

Fix:

../arch/x86/include/asm/proto.h:14:30: warning: ‘struct task_struct’ declared \
inside parameter list will not be visible outside of this definition or declaration
long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2);
^~~~~~~~~~~

.../arch/x86/include/asm/proto.h:40:34: warning: ‘struct task_struct’ declared \
inside parameter list will not be visible outside of this definition or declaration
long do_arch_prctl_common(struct task_struct *task, int option,
^~~~~~~~~~~

if linux/sched.h hasn't be included previously. This fixes a build error
when this header is used outside of the kernel tree.

[ bp: Massage commit message. ]

Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
---
arch/x86/include/asm/proto.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index b6a9d51..8c5d191 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -4,6 +4,8 @@

#include <asm/ldt.h>

+struct task_struct;
+
/* misc architecture specific prototypes */

void syscall_init(void);