* [PATCH v2 1/5] powerpc/rtas: Drop declaration of undefined call_rtas() function
2023-11-14 17:22 [PATCH v2 0/5] powerpc/rtas: Trivial and coding style fixes Nathan Lynch via B4 Relay
@ 2023-11-14 17:22 ` Nathan Lynch via B4 Relay
2023-11-20 3:56 ` Andrew Donnellan
2023-11-14 17:22 ` [PATCH v2 2/5] powerpc/rtas: Remove unused rtas_service_present() Nathan Lynch via B4 Relay
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Nathan Lynch via B4 Relay @ 2023-11-14 17:22 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: Nathan Lynch, linuxppc-dev, Andrew Donnellan, Hari Bathini,
Mahesh Salgaonkar
From: Nathan Lynch <nathanl@linux.ibm.com>
The call_rtas() function has never been a part of arch/powerpc, and
its implementation was removed from arch/ppc by commit 0a26b1364f14
("ppc: Remove CHRP, POWER3 and POWER4 support from arch/ppc").
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index c697c3c74694..3bf7f0a4b07e 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -542,8 +542,6 @@ static inline void pSeries_coalesce_init(void) { }
static inline void rtas_initialize(void) { }
#endif
-extern int call_rtas(const char *, int, int, unsigned long *, ...);
-
#ifdef CONFIG_HV_PERF_CTRS
void read_24x7_sys_info(void);
#else
--
2.41.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v2 1/5] powerpc/rtas: Drop declaration of undefined call_rtas() function
2023-11-14 17:22 ` [PATCH v2 1/5] powerpc/rtas: Drop declaration of undefined call_rtas() function Nathan Lynch via B4 Relay
@ 2023-11-20 3:56 ` Andrew Donnellan
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Donnellan @ 2023-11-20 3:56 UTC (permalink / raw)
To: nathanl, Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: linuxppc-dev, Mahesh Salgaonkar, Hari Bathini
On Tue, 2023-11-14 at 11:22 -0600, Nathan Lynch via B4 Relay wrote:
> From: Nathan Lynch <nathanl@linux.ibm.com>
>
> The call_rtas() function has never been a part of arch/powerpc, and
> its implementation was removed from arch/ppc by commit 0a26b1364f14
> ("ppc: Remove CHRP, POWER3 and POWER4 support from arch/ppc").
>
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
grep confirms this.
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
> ---
> arch/powerpc/include/asm/rtas.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/rtas.h
> b/arch/powerpc/include/asm/rtas.h
> index c697c3c74694..3bf7f0a4b07e 100644
> --- a/arch/powerpc/include/asm/rtas.h
> +++ b/arch/powerpc/include/asm/rtas.h
> @@ -542,8 +542,6 @@ static inline void pSeries_coalesce_init(void) {
> }
> static inline void rtas_initialize(void) { }
> #endif
>
> -extern int call_rtas(const char *, int, int, unsigned long *, ...);
> -
> #ifdef CONFIG_HV_PERF_CTRS
> void read_24x7_sys_info(void);
> #else
>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/5] powerpc/rtas: Remove unused rtas_service_present()
2023-11-14 17:22 [PATCH v2 0/5] powerpc/rtas: Trivial and coding style fixes Nathan Lynch via B4 Relay
2023-11-14 17:22 ` [PATCH v2 1/5] powerpc/rtas: Drop declaration of undefined call_rtas() function Nathan Lynch via B4 Relay
@ 2023-11-14 17:22 ` Nathan Lynch via B4 Relay
2023-11-20 3:56 ` Andrew Donnellan
2023-11-14 17:22 ` [PATCH v2 3/5] powerpc/rtas: Move post_mobility_fixup() declaration to pseries Nathan Lynch via B4 Relay
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Nathan Lynch via B4 Relay @ 2023-11-14 17:22 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: Nathan Lynch, linuxppc-dev, Andrew Donnellan, Hari Bathini,
Mahesh Salgaonkar
From: Nathan Lynch <nathanl@linux.ibm.com>
rtas_service_present() has no more users.
rtas_function_implemented() is now the appropriate API for determining
whether a given RTAS function is available to call.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 1 -
arch/powerpc/kernel/rtas.c | 5 -----
2 files changed, 6 deletions(-)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 3bf7f0a4b07e..c6568a647cd0 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -409,7 +409,6 @@ static inline bool rtas_function_implemented(const rtas_fn_handle_t handle)
return rtas_function_token(handle) != RTAS_UNKNOWN_SERVICE;
}
extern int rtas_token(const char *service);
-extern int rtas_service_present(const char *service);
extern int rtas_call(int token, int, int, int *, ...);
void rtas_call_unlocked(struct rtas_args *args, int token, int nargs,
int nret, ...);
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index eddc031c4b95..b5b340a91157 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -900,11 +900,6 @@ int rtas_token(const char *service)
}
EXPORT_SYMBOL_GPL(rtas_token);
-int rtas_service_present(const char *service)
-{
- return rtas_token(service) != RTAS_UNKNOWN_SERVICE;
-}
-
#ifdef CONFIG_RTAS_ERROR_LOGGING
static u32 rtas_error_log_max __ro_after_init = RTAS_ERROR_LOG_MAX;
--
2.41.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v2 2/5] powerpc/rtas: Remove unused rtas_service_present()
2023-11-14 17:22 ` [PATCH v2 2/5] powerpc/rtas: Remove unused rtas_service_present() Nathan Lynch via B4 Relay
@ 2023-11-20 3:56 ` Andrew Donnellan
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Donnellan @ 2023-11-20 3:56 UTC (permalink / raw)
To: nathanl, Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: linuxppc-dev, Mahesh Salgaonkar, Hari Bathini
On Tue, 2023-11-14 at 11:22 -0600, Nathan Lynch via B4 Relay wrote:
> From: Nathan Lynch <nathanl@linux.ibm.com>
>
> rtas_service_present() has no more users.
>
> rtas_function_implemented() is now the appropriate API for
> determining
> whether a given RTAS function is available to call.
>
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
grep confirms this.
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
> ---
> arch/powerpc/include/asm/rtas.h | 1 -
> arch/powerpc/kernel/rtas.c | 5 -----
> 2 files changed, 6 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/rtas.h
> b/arch/powerpc/include/asm/rtas.h
> index 3bf7f0a4b07e..c6568a647cd0 100644
> --- a/arch/powerpc/include/asm/rtas.h
> +++ b/arch/powerpc/include/asm/rtas.h
> @@ -409,7 +409,6 @@ static inline bool
> rtas_function_implemented(const rtas_fn_handle_t handle)
> return rtas_function_token(handle) != RTAS_UNKNOWN_SERVICE;
> }
> extern int rtas_token(const char *service);
> -extern int rtas_service_present(const char *service);
> extern int rtas_call(int token, int, int, int *, ...);
> void rtas_call_unlocked(struct rtas_args *args, int token, int
> nargs,
> int nret, ...);
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index eddc031c4b95..b5b340a91157 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -900,11 +900,6 @@ int rtas_token(const char *service)
> }
> EXPORT_SYMBOL_GPL(rtas_token);
>
> -int rtas_service_present(const char *service)
> -{
> - return rtas_token(service) != RTAS_UNKNOWN_SERVICE;
> -}
> -
> #ifdef CONFIG_RTAS_ERROR_LOGGING
>
> static u32 rtas_error_log_max __ro_after_init = RTAS_ERROR_LOG_MAX;
>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 3/5] powerpc/rtas: Move post_mobility_fixup() declaration to pseries
2023-11-14 17:22 [PATCH v2 0/5] powerpc/rtas: Trivial and coding style fixes Nathan Lynch via B4 Relay
2023-11-14 17:22 ` [PATCH v2 1/5] powerpc/rtas: Drop declaration of undefined call_rtas() function Nathan Lynch via B4 Relay
2023-11-14 17:22 ` [PATCH v2 2/5] powerpc/rtas: Remove unused rtas_service_present() Nathan Lynch via B4 Relay
@ 2023-11-14 17:22 ` Nathan Lynch via B4 Relay
2023-11-20 3:58 ` Andrew Donnellan
2023-11-14 17:22 ` [PATCH v2 4/5] powerpc/rtas: Remove trailing space Nathan Lynch via B4 Relay
2023-11-14 17:22 ` [PATCH v2 5/5] powerpc/rtas: Remove 'extern' from function declarations in rtas.h Nathan Lynch via B4 Relay
4 siblings, 1 reply; 11+ messages in thread
From: Nathan Lynch via B4 Relay @ 2023-11-14 17:22 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: Nathan Lynch, linuxppc-dev, Andrew Donnellan, Hari Bathini,
Mahesh Salgaonkar
From: Nathan Lynch <nathanl@linux.ibm.com>
This is a pseries-specific function declaration that doesn't belong in
rtas.h. Move it to the pseries platform code and adjust
pseries/suspend.c accordingly.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 1 -
arch/powerpc/platforms/pseries/pseries.h | 1 +
arch/powerpc/platforms/pseries/suspend.c | 1 +
3 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index c6568a647cd0..2365668fc13e 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -444,7 +444,6 @@ extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
#ifdef CONFIG_PPC_PSERIES
extern time64_t last_rtas_event;
extern int clobbering_unread_rtas_event(void);
-extern void post_mobility_fixup(void);
int rtas_syscall_dispatch_ibm_suspend_me(u64 handle);
#else
static inline int clobbering_unread_rtas_event(void) { return 0; }
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 8376f03f932a..1c2d736f600d 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -55,6 +55,7 @@ extern int dlpar_detach_node(struct device_node *);
extern int dlpar_acquire_drc(u32 drc_index);
extern int dlpar_release_drc(u32 drc_index);
extern int dlpar_unisolate_drc(u32 drc_index);
+void post_mobility_fixup(void);
void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog);
int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_errlog);
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index 5c43435472cc..382003dfdb9a 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -13,6 +13,7 @@
#include <asm/mmu.h>
#include <asm/rtas.h>
#include <asm/topology.h>
+#include "pseries.h"
static struct device suspend_dev;
--
2.41.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v2 3/5] powerpc/rtas: Move post_mobility_fixup() declaration to pseries
2023-11-14 17:22 ` [PATCH v2 3/5] powerpc/rtas: Move post_mobility_fixup() declaration to pseries Nathan Lynch via B4 Relay
@ 2023-11-20 3:58 ` Andrew Donnellan
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Donnellan @ 2023-11-20 3:58 UTC (permalink / raw)
To: nathanl, Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: linuxppc-dev, Mahesh Salgaonkar, Hari Bathini
On Tue, 2023-11-14 at 11:22 -0600, Nathan Lynch via B4 Relay wrote:
> From: Nathan Lynch <nathanl@linux.ibm.com>
>
> This is a pseries-specific function declaration that doesn't belong
> in
> rtas.h. Move it to the pseries platform code and adjust
> pseries/suspend.c accordingly.
>
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
This looks correct to me (the other user is in mobility.c which already
has the header file included).
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
> ---
> arch/powerpc/include/asm/rtas.h | 1 -
> arch/powerpc/platforms/pseries/pseries.h | 1 +
> arch/powerpc/platforms/pseries/suspend.c | 1 +
> 3 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/rtas.h
> b/arch/powerpc/include/asm/rtas.h
> index c6568a647cd0..2365668fc13e 100644
> --- a/arch/powerpc/include/asm/rtas.h
> +++ b/arch/powerpc/include/asm/rtas.h
> @@ -444,7 +444,6 @@ extern void pSeries_log_error(char *buf, unsigned
> int err_type, int fatal);
> #ifdef CONFIG_PPC_PSERIES
> extern time64_t last_rtas_event;
> extern int clobbering_unread_rtas_event(void);
> -extern void post_mobility_fixup(void);
> int rtas_syscall_dispatch_ibm_suspend_me(u64 handle);
> #else
> static inline int clobbering_unread_rtas_event(void) { return 0; }
> diff --git a/arch/powerpc/platforms/pseries/pseries.h
> b/arch/powerpc/platforms/pseries/pseries.h
> index 8376f03f932a..1c2d736f600d 100644
> --- a/arch/powerpc/platforms/pseries/pseries.h
> +++ b/arch/powerpc/platforms/pseries/pseries.h
> @@ -55,6 +55,7 @@ extern int dlpar_detach_node(struct device_node *);
> extern int dlpar_acquire_drc(u32 drc_index);
> extern int dlpar_release_drc(u32 drc_index);
> extern int dlpar_unisolate_drc(u32 drc_index);
> +void post_mobility_fixup(void);
>
> void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog);
> int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_errlog);
> diff --git a/arch/powerpc/platforms/pseries/suspend.c
> b/arch/powerpc/platforms/pseries/suspend.c
> index 5c43435472cc..382003dfdb9a 100644
> --- a/arch/powerpc/platforms/pseries/suspend.c
> +++ b/arch/powerpc/platforms/pseries/suspend.c
> @@ -13,6 +13,7 @@
> #include <asm/mmu.h>
> #include <asm/rtas.h>
> #include <asm/topology.h>
> +#include "pseries.h"
>
> static struct device suspend_dev;
>
>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 4/5] powerpc/rtas: Remove trailing space
2023-11-14 17:22 [PATCH v2 0/5] powerpc/rtas: Trivial and coding style fixes Nathan Lynch via B4 Relay
` (2 preceding siblings ...)
2023-11-14 17:22 ` [PATCH v2 3/5] powerpc/rtas: Move post_mobility_fixup() declaration to pseries Nathan Lynch via B4 Relay
@ 2023-11-14 17:22 ` Nathan Lynch via B4 Relay
2023-11-20 4:00 ` Andrew Donnellan
2023-11-14 17:22 ` [PATCH v2 5/5] powerpc/rtas: Remove 'extern' from function declarations in rtas.h Nathan Lynch via B4 Relay
4 siblings, 1 reply; 11+ messages in thread
From: Nathan Lynch via B4 Relay @ 2023-11-14 17:22 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: Nathan Lynch, linuxppc-dev, Andrew Donnellan, Hari Bathini,
Mahesh Salgaonkar
From: Nathan Lynch <nathanl@linux.ibm.com>
Use scripts/cleanfile to remove instances of trailing space in the
core RTAS code and header.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 6 +++---
arch/powerpc/kernel/rtas.c | 18 +++++++++---------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 2365668fc13e..1bed6be8ada3 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -268,7 +268,7 @@ typedef struct {
#define RTAS_TYPE_DEALLOC 0xE3
#define RTAS_TYPE_DUMP 0xE4
#define RTAS_TYPE_HOTPLUG 0xE5
-/* I don't add PowerMGM events right now, this is a different topic */
+/* I don't add PowerMGM events right now, this is a different topic */
#define RTAS_TYPE_PMGM_POWER_SW_ON 0x60
#define RTAS_TYPE_PMGM_POWER_SW_OFF 0x61
#define RTAS_TYPE_PMGM_LID_OPEN 0x62
@@ -461,7 +461,7 @@ static inline void rtas_cancel_event_scan(void) { }
/* Error types logged. */
#define ERR_FLAG_ALREADY_LOGGED 0x0
-#define ERR_FLAG_BOOT 0x1 /* log was pulled from NVRAM on boot */
+#define ERR_FLAG_BOOT 0x1 /* log was pulled from NVRAM on boot */
#define ERR_TYPE_RTAS_LOG 0x2 /* from rtas event-scan */
#define ERR_TYPE_KERNEL_PANIC 0x4 /* from die()/panic() */
#define ERR_TYPE_KERNEL_PANIC_GZ 0x8 /* ditto, compressed */
@@ -471,7 +471,7 @@ static inline void rtas_cancel_event_scan(void) { }
(ERR_TYPE_RTAS_LOG | ERR_TYPE_KERNEL_PANIC | ERR_TYPE_KERNEL_PANIC_GZ)
#define RTAS_DEBUG KERN_DEBUG "RTAS: "
-
+
#define RTAS_ERROR_LOG_MAX 2048
/*
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index b5b340a91157..c49f078382a9 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -670,7 +670,7 @@ static void call_rtas_display_status_delay(char c)
static int pending_newline = 0; /* did last write end with unprinted newline? */
static int width = 16;
- if (c == '\n') {
+ if (c == '\n') {
while (width-- > 0)
call_rtas_display_status(' ');
width = 16;
@@ -680,7 +680,7 @@ static void call_rtas_display_status_delay(char c)
if (pending_newline) {
call_rtas_display_status('\r');
call_rtas_display_status('\n');
- }
+ }
pending_newline = 0;
if (width--) {
call_rtas_display_status(c);
@@ -820,7 +820,7 @@ void rtas_progress(char *s, unsigned short hex)
else
rtas_call(display_character, 1, 1, NULL, '\r');
}
-
+
if (row_width)
width = row_width[current_line];
else
@@ -840,9 +840,9 @@ void rtas_progress(char *s, unsigned short hex)
spin_unlock(&progress_lock);
return;
}
-
+
/* RTAS wants CR-LF, not just LF */
-
+
if (*os == '\n') {
rtas_call(display_character, 1, 1, NULL, '\r');
rtas_call(display_character, 1, 1, NULL, '\n');
@@ -852,7 +852,7 @@ void rtas_progress(char *s, unsigned short hex)
*/
rtas_call(display_character, 1, 1, NULL, *os);
}
-
+
if (row_width)
width = row_width[current_line];
else
@@ -861,15 +861,15 @@ void rtas_progress(char *s, unsigned short hex)
width--;
rtas_call(display_character, 1, 1, NULL, *os);
}
-
+
os++;
-
+
/* if we overwrite the screen length */
if (width <= 0)
while ((*os != 0) && (*os != '\n') && (*os != '\r'))
os++;
}
-
+
spin_unlock(&progress_lock);
}
EXPORT_SYMBOL_GPL(rtas_progress); /* needed by rtas_flash module */
--
2.41.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v2 4/5] powerpc/rtas: Remove trailing space
2023-11-14 17:22 ` [PATCH v2 4/5] powerpc/rtas: Remove trailing space Nathan Lynch via B4 Relay
@ 2023-11-20 4:00 ` Andrew Donnellan
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Donnellan @ 2023-11-20 4:00 UTC (permalink / raw)
To: nathanl, Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: linuxppc-dev, Mahesh Salgaonkar, Hari Bathini
On Tue, 2023-11-14 at 11:22 -0600, Nathan Lynch via B4 Relay wrote:
> From: Nathan Lynch <nathanl@linux.ibm.com>
>
> Use scripts/cleanfile to remove instances of trailing space in the
> core RTAS code and header.
>
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Thanks for the cleanup, LGTM.
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
> ---
> arch/powerpc/include/asm/rtas.h | 6 +++---
> arch/powerpc/kernel/rtas.c | 18 +++++++++---------
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/rtas.h
> b/arch/powerpc/include/asm/rtas.h
> index 2365668fc13e..1bed6be8ada3 100644
> --- a/arch/powerpc/include/asm/rtas.h
> +++ b/arch/powerpc/include/asm/rtas.h
> @@ -268,7 +268,7 @@ typedef struct {
> #define RTAS_TYPE_DEALLOC 0xE3
> #define RTAS_TYPE_DUMP 0xE4
> #define RTAS_TYPE_HOTPLUG 0xE5
> -/* I don't add PowerMGM events right now, this is a different topic
> */
> +/* I don't add PowerMGM events right now, this is a different topic
> */
> #define RTAS_TYPE_PMGM_POWER_SW_ON 0x60
> #define RTAS_TYPE_PMGM_POWER_SW_OFF 0x61
> #define RTAS_TYPE_PMGM_LID_OPEN 0x62
> @@ -461,7 +461,7 @@ static inline void rtas_cancel_event_scan(void) {
> }
>
> /* Error types logged. */
> #define ERR_FLAG_ALREADY_LOGGED 0x0
> -#define ERR_FLAG_BOOT 0x1 /* log was pulled from NVRAM
> on boot */
> +#define ERR_FLAG_BOOT 0x1 /* log was pulled from NVRAM
> on boot */
> #define ERR_TYPE_RTAS_LOG 0x2 /* from rtas event-scan */
> #define ERR_TYPE_KERNEL_PANIC 0x4 /* from die()/panic() */
> #define ERR_TYPE_KERNEL_PANIC_GZ 0x8 /* ditto, compressed */
> @@ -471,7 +471,7 @@ static inline void rtas_cancel_event_scan(void) {
> }
> (ERR_TYPE_RTAS_LOG | ERR_TYPE_KERNEL_PANIC |
> ERR_TYPE_KERNEL_PANIC_GZ)
>
> #define RTAS_DEBUG KERN_DEBUG "RTAS: "
> -
> +
> #define RTAS_ERROR_LOG_MAX 2048
>
> /*
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index b5b340a91157..c49f078382a9 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -670,7 +670,7 @@ static void call_rtas_display_status_delay(char
> c)
> static int pending_newline = 0; /* did last write end with
> unprinted newline? */
> static int width = 16;
>
> - if (c == '\n') {
> + if (c == '\n') {
> while (width-- > 0)
> call_rtas_display_status(' ');
> width = 16;
> @@ -680,7 +680,7 @@ static void call_rtas_display_status_delay(char
> c)
> if (pending_newline) {
> call_rtas_display_status('\r');
> call_rtas_display_status('\n');
> - }
> + }
> pending_newline = 0;
> if (width--) {
> call_rtas_display_status(c);
> @@ -820,7 +820,7 @@ void rtas_progress(char *s, unsigned short hex)
> else
> rtas_call(display_character, 1, 1, NULL,
> '\r');
> }
> -
> +
> if (row_width)
> width = row_width[current_line];
> else
> @@ -840,9 +840,9 @@ void rtas_progress(char *s, unsigned short hex)
> spin_unlock(&progress_lock);
> return;
> }
> -
> +
> /* RTAS wants CR-LF, not just LF */
> -
> +
> if (*os == '\n') {
> rtas_call(display_character, 1, 1,
> NULL, '\r');
> rtas_call(display_character, 1, 1,
> NULL, '\n');
> @@ -852,7 +852,7 @@ void rtas_progress(char *s, unsigned short hex)
> */
> rtas_call(display_character, 1, 1,
> NULL, *os);
> }
> -
> +
> if (row_width)
> width = row_width[current_line];
> else
> @@ -861,15 +861,15 @@ void rtas_progress(char *s, unsigned short hex)
> width--;
> rtas_call(display_character, 1, 1, NULL,
> *os);
> }
> -
> +
> os++;
> -
> +
> /* if we overwrite the screen length */
> if (width <= 0)
> while ((*os != 0) && (*os != '\n') && (*os
> != '\r'))
> os++;
> }
> -
> +
> spin_unlock(&progress_lock);
> }
> EXPORT_SYMBOL_GPL(rtas_progress); /* needed by
> rtas_flash module */
>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 5/5] powerpc/rtas: Remove 'extern' from function declarations in rtas.h
2023-11-14 17:22 [PATCH v2 0/5] powerpc/rtas: Trivial and coding style fixes Nathan Lynch via B4 Relay
` (3 preceding siblings ...)
2023-11-14 17:22 ` [PATCH v2 4/5] powerpc/rtas: Remove trailing space Nathan Lynch via B4 Relay
@ 2023-11-14 17:22 ` Nathan Lynch via B4 Relay
2023-11-20 4:02 ` Andrew Donnellan
4 siblings, 1 reply; 11+ messages in thread
From: Nathan Lynch via B4 Relay @ 2023-11-14 17:22 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: Nathan Lynch, linuxppc-dev, Andrew Donnellan, Hari Bathini,
Mahesh Salgaonkar
From: Nathan Lynch <nathanl@linux.ibm.com>
This header occasionally gains new function declarations without the
leading extern in accordance with current style rules. Leaving the
legacy externs in place is making the header more difficult to read
over time because of the inconsistency. Remove them, fixing up
checkpatch issues with unnamed parameters (rtas_call) and bracket
alignment (early_init_dt_scan_rtas) that get raised as a result of
touching the code.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 53 ++++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 27 deletions(-)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 1bed6be8ada3..a7110ed52e25 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -408,42 +408,41 @@ static inline bool rtas_function_implemented(const rtas_fn_handle_t handle)
{
return rtas_function_token(handle) != RTAS_UNKNOWN_SERVICE;
}
-extern int rtas_token(const char *service);
-extern int rtas_call(int token, int, int, int *, ...);
+int rtas_token(const char *service);
+int rtas_call(int token, int nargs, int nret, int *outputs, ...);
void rtas_call_unlocked(struct rtas_args *args, int token, int nargs,
int nret, ...);
-extern void __noreturn rtas_restart(char *cmd);
-extern void rtas_power_off(void);
-extern void __noreturn rtas_halt(void);
-extern void rtas_os_term(char *str);
+void __noreturn rtas_restart(char *cmd);
+void rtas_power_off(void);
+void __noreturn rtas_halt(void);
+void rtas_os_term(char *str);
void rtas_activate_firmware(void);
-extern int rtas_get_sensor(int sensor, int index, int *state);
-extern int rtas_get_sensor_fast(int sensor, int index, int *state);
-extern int rtas_get_power_level(int powerdomain, int *level);
-extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);
-extern bool rtas_indicator_present(int token, int *maxindex);
-extern int rtas_set_indicator(int indicator, int index, int new_value);
-extern int rtas_set_indicator_fast(int indicator, int index, int new_value);
-extern void rtas_progress(char *s, unsigned short hex);
+int rtas_get_sensor(int sensor, int index, int *state);
+int rtas_get_sensor_fast(int sensor, int index, int *state);
+int rtas_get_power_level(int powerdomain, int *level);
+int rtas_set_power_level(int powerdomain, int level, int *setlevel);
+bool rtas_indicator_present(int token, int *maxindex);
+int rtas_set_indicator(int indicator, int index, int new_value);
+int rtas_set_indicator_fast(int indicator, int index, int new_value);
+void rtas_progress(char *s, unsigned short hex);
int rtas_ibm_suspend_me(int *fw_status);
int rtas_error_rc(int rtas_rc);
struct rtc_time;
-extern time64_t rtas_get_boot_time(void);
-extern void rtas_get_rtc_time(struct rtc_time *rtc_time);
-extern int rtas_set_rtc_time(struct rtc_time *rtc_time);
+time64_t rtas_get_boot_time(void);
+void rtas_get_rtc_time(struct rtc_time *rtc_time);
+int rtas_set_rtc_time(struct rtc_time *rtc_time);
-extern unsigned int rtas_busy_delay_time(int status);
+unsigned int rtas_busy_delay_time(int status);
bool rtas_busy_delay(int status);
-extern int early_init_dt_scan_rtas(unsigned long node,
- const char *uname, int depth, void *data);
+int early_init_dt_scan_rtas(unsigned long node, const char *uname, int depth, void *data);
-extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
+void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
#ifdef CONFIG_PPC_PSERIES
extern time64_t last_rtas_event;
-extern int clobbering_unread_rtas_event(void);
+int clobbering_unread_rtas_event(void);
int rtas_syscall_dispatch_ibm_suspend_me(u64 handle);
#else
static inline int clobbering_unread_rtas_event(void) { return 0; }
@@ -454,7 +453,7 @@ static inline int rtas_syscall_dispatch_ibm_suspend_me(u64 handle)
#endif
#ifdef CONFIG_PPC_RTAS_DAEMON
-extern void rtas_cancel_event_scan(void);
+void rtas_cancel_event_scan(void);
#else
static inline void rtas_cancel_event_scan(void) { }
#endif
@@ -479,7 +478,7 @@ static inline void rtas_cancel_event_scan(void) { }
* for all rtas calls that require an error buffer argument.
* This includes 'check-exception' and 'rtas-last-error'.
*/
-extern int rtas_get_error_log_max(void);
+int rtas_get_error_log_max(void);
/* Event Scan Parameters */
#define EVENT_SCAN_ALL_EVENTS 0xf0000000
@@ -518,8 +517,8 @@ static inline u32 rtas_config_addr(int busno, int devfn, int reg)
(devfn << 8) | (reg & 0xff);
}
-extern void rtas_give_timebase(void);
-extern void rtas_take_timebase(void);
+void rtas_give_timebase(void);
+void rtas_take_timebase(void);
#ifdef CONFIG_PPC_RTAS
static inline int page_is_rtas_user_buf(unsigned long pfn)
@@ -532,7 +531,7 @@ static inline int page_is_rtas_user_buf(unsigned long pfn)
/* Not the best place to put pSeries_coalesce_init, will be fixed when we
* move some of the rtas suspend-me stuff to pseries */
-extern void pSeries_coalesce_init(void);
+void pSeries_coalesce_init(void);
void rtas_initialize(void);
#else
static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;}
--
2.41.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v2 5/5] powerpc/rtas: Remove 'extern' from function declarations in rtas.h
2023-11-14 17:22 ` [PATCH v2 5/5] powerpc/rtas: Remove 'extern' from function declarations in rtas.h Nathan Lynch via B4 Relay
@ 2023-11-20 4:02 ` Andrew Donnellan
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Donnellan @ 2023-11-20 4:02 UTC (permalink / raw)
To: nathanl, Michael Ellerman, Nicholas Piggin, Christophe Leroy
Cc: linuxppc-dev, Mahesh Salgaonkar, Hari Bathini
On Tue, 2023-11-14 at 11:22 -0600, Nathan Lynch via B4 Relay wrote:
> From: Nathan Lynch <nathanl@linux.ibm.com>
>
> This header occasionally gains new function declarations without the
> leading extern in accordance with current style rules. Leaving the
> legacy externs in place is making the header more difficult to read
> over time because of the inconsistency. Remove them, fixing up
> checkpatch issues with unnamed parameters (rtas_call) and bracket
> alignment (early_init_dt_scan_rtas) that get raised as a result of
> touching the code.
>
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>'
LGTM
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
> ---
> arch/powerpc/include/asm/rtas.h | 53 ++++++++++++++++++++-----------
> ----------
> 1 file changed, 26 insertions(+), 27 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/rtas.h
> b/arch/powerpc/include/asm/rtas.h
> index 1bed6be8ada3..a7110ed52e25 100644
> --- a/arch/powerpc/include/asm/rtas.h
> +++ b/arch/powerpc/include/asm/rtas.h
> @@ -408,42 +408,41 @@ static inline bool
> rtas_function_implemented(const rtas_fn_handle_t handle)
> {
> return rtas_function_token(handle) != RTAS_UNKNOWN_SERVICE;
> }
> -extern int rtas_token(const char *service);
> -extern int rtas_call(int token, int, int, int *, ...);
> +int rtas_token(const char *service);
> +int rtas_call(int token, int nargs, int nret, int *outputs, ...);
> void rtas_call_unlocked(struct rtas_args *args, int token, int
> nargs,
> int nret, ...);
> -extern void __noreturn rtas_restart(char *cmd);
> -extern void rtas_power_off(void);
> -extern void __noreturn rtas_halt(void);
> -extern void rtas_os_term(char *str);
> +void __noreturn rtas_restart(char *cmd);
> +void rtas_power_off(void);
> +void __noreturn rtas_halt(void);
> +void rtas_os_term(char *str);
> void rtas_activate_firmware(void);
> -extern int rtas_get_sensor(int sensor, int index, int *state);
> -extern int rtas_get_sensor_fast(int sensor, int index, int *state);
> -extern int rtas_get_power_level(int powerdomain, int *level);
> -extern int rtas_set_power_level(int powerdomain, int level, int
> *setlevel);
> -extern bool rtas_indicator_present(int token, int *maxindex);
> -extern int rtas_set_indicator(int indicator, int index, int
> new_value);
> -extern int rtas_set_indicator_fast(int indicator, int index, int
> new_value);
> -extern void rtas_progress(char *s, unsigned short hex);
> +int rtas_get_sensor(int sensor, int index, int *state);
> +int rtas_get_sensor_fast(int sensor, int index, int *state);
> +int rtas_get_power_level(int powerdomain, int *level);
> +int rtas_set_power_level(int powerdomain, int level, int *setlevel);
> +bool rtas_indicator_present(int token, int *maxindex);
> +int rtas_set_indicator(int indicator, int index, int new_value);
> +int rtas_set_indicator_fast(int indicator, int index, int
> new_value);
> +void rtas_progress(char *s, unsigned short hex);
> int rtas_ibm_suspend_me(int *fw_status);
> int rtas_error_rc(int rtas_rc);
>
> struct rtc_time;
> -extern time64_t rtas_get_boot_time(void);
> -extern void rtas_get_rtc_time(struct rtc_time *rtc_time);
> -extern int rtas_set_rtc_time(struct rtc_time *rtc_time);
> +time64_t rtas_get_boot_time(void);
> +void rtas_get_rtc_time(struct rtc_time *rtc_time);
> +int rtas_set_rtc_time(struct rtc_time *rtc_time);
>
> -extern unsigned int rtas_busy_delay_time(int status);
> +unsigned int rtas_busy_delay_time(int status);
> bool rtas_busy_delay(int status);
>
> -extern int early_init_dt_scan_rtas(unsigned long node,
> - const char *uname, int depth, void *data);
> +int early_init_dt_scan_rtas(unsigned long node, const char *uname,
> int depth, void *data);
>
> -extern void pSeries_log_error(char *buf, unsigned int err_type, int
> fatal);
> +void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
>
> #ifdef CONFIG_PPC_PSERIES
> extern time64_t last_rtas_event;
> -extern int clobbering_unread_rtas_event(void);
> +int clobbering_unread_rtas_event(void);
> int rtas_syscall_dispatch_ibm_suspend_me(u64 handle);
> #else
> static inline int clobbering_unread_rtas_event(void) { return 0; }
> @@ -454,7 +453,7 @@ static inline int
> rtas_syscall_dispatch_ibm_suspend_me(u64 handle)
> #endif
>
> #ifdef CONFIG_PPC_RTAS_DAEMON
> -extern void rtas_cancel_event_scan(void);
> +void rtas_cancel_event_scan(void);
> #else
> static inline void rtas_cancel_event_scan(void) { }
> #endif
> @@ -479,7 +478,7 @@ static inline void rtas_cancel_event_scan(void) {
> }
> * for all rtas calls that require an error buffer argument.
> * This includes 'check-exception' and 'rtas-last-error'.
> */
> -extern int rtas_get_error_log_max(void);
> +int rtas_get_error_log_max(void);
>
> /* Event Scan Parameters */
> #define EVENT_SCAN_ALL_EVENTS 0xf0000000
> @@ -518,8 +517,8 @@ static inline u32 rtas_config_addr(int busno, int
> devfn, int reg)
> (devfn << 8) | (reg & 0xff);
> }
>
> -extern void rtas_give_timebase(void);
> -extern void rtas_take_timebase(void);
> +void rtas_give_timebase(void);
> +void rtas_take_timebase(void);
>
> #ifdef CONFIG_PPC_RTAS
> static inline int page_is_rtas_user_buf(unsigned long pfn)
> @@ -532,7 +531,7 @@ static inline int page_is_rtas_user_buf(unsigned
> long pfn)
>
> /* Not the best place to put pSeries_coalesce_init, will be fixed
> when we
> * move some of the rtas suspend-me stuff to pseries */
> -extern void pSeries_coalesce_init(void);
> +void pSeries_coalesce_init(void);
> void rtas_initialize(void);
> #else
> static inline int page_is_rtas_user_buf(unsigned long pfn) { return
> 0;}
>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 11+ messages in thread