Skip to contentSkip to conversation

hexagon: Move kernel prototypes out of uapi/asm/setup.h header

PATCH In review Thomas Huth 2 participants 3 messages May 2, 2024 – Oct 22, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hexagon: Move kernel prototypes out of uapi/asm/setup.h header

The kernel function prototypes are of no use for userspace and shouldn't get exposed in an uapi header, so let's move them into an internal header instead.

---
 arch/hexagon/include/asm/setup.h      | 20 ++++++++++++++++++++
 arch/hexagon/include/uapi/asm/setup.h | 14 ++------------
 2 files changed, 22 insertions(+), 12 deletions(-)
 create mode 100644 arch/hexagon/include/asm/setup.h
arch/hexagon/include/asm/setup.h new file +20 -0
new file mode 100644
index 000000000000..9f2749cd4052
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ */
+
+#ifndef _ASM_HEXAGON_SETUP_H
+#define _ASM_HEXAGON_SETUP_H
+
+#include <linux/init.h>
+#include <uapi/asm/setup.h>
+
+extern char external_cmdline_buffer;
+
+void __init setup_arch_memory(void);
+
+#endif
arch/hexagon/include/uapi/asm/setup.h +2 -12
index 8ce9428b1583..598f74f671f6 100644
@@ -17,19 +17,9 @@
  * 02110-1301, USA.
  */
 
-#ifndef _ASM_SETUP_H
-#define _ASM_SETUP_H
-
-#ifdef __KERNEL__
-#include <linux/init.h>
-#else
-#define __init
-#endif
+#ifndef _UAPI_ASM_HEXAGON_SETUP_H
+#define _UAPI_ASM_HEXAGON_SETUP_H
 
 #include <asm-generic/setup.h>
 
-extern char external_cmdline_buffer;
-
-void __init setup_arch_memory(void);
-
 #endif
Signature · 1 line
2.44.0
#1 lore raw
Quoted 53 lines · Thomas Huth

The kernel function prototypes are of no use for userspace and shouldn't get exposed in an uapi header, so let's move them into an internal header instead.

---
  arch/hexagon/include/asm/setup.h      | 20 ++++++++++++++++++++
  arch/hexagon/include/uapi/asm/setup.h | 14 ++------------
  2 files changed, 22 insertions(+), 12 deletions(-)

create mode 100644 arch/hexagon/include/asm/setup.h

arch/hexagon/include/asm/setup.h new file +20 -0
new file mode 100644
index 000000000000..9f2749cd4052
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ */
+
+#ifndef _ASM_HEXAGON_SETUP_H
+#define _ASM_HEXAGON_SETUP_H
+
+#include <linux/init.h>
+#include <uapi/asm/setup.h>
+
+extern char external_cmdline_buffer;
+
+void __init setup_arch_memory(void);
+
+#endif
arch/hexagon/include/uapi/asm/setup.h +0 -8
index 8ce9428b1583..598f74f671f6 100644
@@ -17,19 +17,9 @@
   * 02110-1301, USA.
   */
 
-#ifndef _ASM_SETUP_H
-#define _ASM_SETUP_H
-
-#ifdef __KERNEL__
-#include <linux/init.h>
-#else
-#define __init
-#endif

arch/hexagon/include/uapi/asm/setup.h line 25

Quoted 10 lines
arch/hexagon/include/uapi/asm/setup.h +2 -4
+#ifndef _UAPI_ASM_HEXAGON_SETUP_H
+#define _UAPI_ASM_HEXAGON_SETUP_H
 
  #include <asm-generic/setup.h>
 
-extern char external_cmdline_buffer;
-
-void __init setup_arch_memory(void);
-
  #endif

Ping?

Thomas

Reviewed-by
#2 lore raw
Quoted 11 lines

-----Original Message-----
From: Thomas Huth <[email protected]>
Sent: Tuesday, October 22, 2024 1:44 PM
To: Brian Cain <[email protected]>
Cc: [email protected]; Arnd Bergmann <[email protected]>; linux- [email protected]; [email protected]
Subject: Re: [PATCH] hexagon: Move kernel prototypes out of uapi/asm/setup.h header

Quoted 10 lines

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 6 lines · Thomas Huth

The kernel function prototypes are of no use for userspace and shouldn't get exposed in an uapi header, so let's move them into an internal header instead.

---

Quoted 63 lines

Review

Quoted 6 lines
  arch/hexagon/include/asm/setup.h      | 20 ++++++++++++++++++++
  arch/hexagon/include/uapi/asm/setup.h | 14 ++------------
  2 files changed, 22 insertions(+), 12 deletions(-)

create mode 100644 arch/hexagon/include/asm/setup.h

(quoted diff) +0 -0

b/arch/hexagon/include/asm/setup.h

Review

Quoted 26 lines

new file mode 100644
index 000000000000..9f2749cd4052

arch/hexagon/include/asm/setup.h new file +20 -0
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ */
+
+#ifndef _ASM_HEXAGON_SETUP_H
+#define _ASM_HEXAGON_SETUP_H
+
+#include <linux/init.h>
+#include <uapi/asm/setup.h>
+
+extern char external_cmdline_buffer;
+
+void __init setup_arch_memory(void);
+
+#endif
(quoted diff) +0 -0

b/arch/hexagon/include/uapi/asm/setup.h

Quoted 15 lines

index 8ce9428b1583..598f74f671f6 100644

arch/hexagon/include/uapi/asm/setup.h +0 -8
@@ -17,19 +17,9 @@
   * 02110-1301, USA.
   */
 
-#ifndef _ASM_SETUP_H
-#define _ASM_SETUP_H
-
-#ifdef __KERNEL__
-#include <linux/init.h>
-#else
-#define __init
-#endif

arch/hexagon/include/uapi/asm/setup.h line 25

Quoted 10 lines
arch/hexagon/include/uapi/asm/setup.h +2 -4
+#ifndef _UAPI_ASM_HEXAGON_SETUP_H
+#define _UAPI_ASM_HEXAGON_SETUP_H
 
  #include <asm-generic/setup.h>
 
-extern char external_cmdline_buffer;
-
-void __init setup_arch_memory(void);
-
  #endif

Ping?

Thomas