2020-06-11 09:14:06

by Joerg Roedel

[permalink] [raw]
Subject: [PATCH] alpha: Fix build around srm_sysrq_reboot_op

From: Joerg Roedel <[email protected]>

The patch introducing the struct was probably never compile tested,
because it sets a handler with a wrong function signature. Wrap the
handler into a functions with the correct signature to fix the build.

Fixes: 0f1c9688a194 ("tty/sysrq: alpha: export and use __sysrq_get_key_op()")
Cc: Emil Velikov <[email protected]>
Cc: Guenter Roeck <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
---
arch/alpha/kernel/setup.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index f5c42a8fcf9c..53520f8cb904 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -430,8 +430,13 @@ register_cpus(void)
arch_initcall(register_cpus);

#ifdef CONFIG_MAGIC_SYSRQ
+static void sysrq_reboot_handler(int unused)
+{
+ machine_halt();
+}
+
static const struct sysrq_key_op srm_sysrq_reboot_op = {
- .handler = machine_halt,
+ .handler = sysrq_reboot_handler,
.help_msg = "reboot(b)",
.action_msg = "Resetting",
.enable_mask = SYSRQ_ENABLE_BOOT,
--
2.26.2


2020-06-11 13:26:39

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] alpha: Fix build around srm_sysrq_reboot_op

On Thu, Jun 11, 2020 at 11:11:39AM +0200, Joerg Roedel wrote:
> From: Joerg Roedel <[email protected]>
>
> The patch introducing the struct was probably never compile tested,
> because it sets a handler with a wrong function signature. Wrap the
> handler into a functions with the correct signature to fix the build.
>
> Fixes: 0f1c9688a194 ("tty/sysrq: alpha: export and use __sysrq_get_key_op()")
> Cc: Emil Velikov <[email protected]>
> Cc: Guenter Roeck <[email protected]>
> Signed-off-by: Joerg Roedel <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>
Tested-by: Guenter Roeck <[email protected]>

> ---
> arch/alpha/kernel/setup.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
> index f5c42a8fcf9c..53520f8cb904 100644
> --- a/arch/alpha/kernel/setup.c
> +++ b/arch/alpha/kernel/setup.c
> @@ -430,8 +430,13 @@ register_cpus(void)
> arch_initcall(register_cpus);
>
> #ifdef CONFIG_MAGIC_SYSRQ
> +static void sysrq_reboot_handler(int unused)
> +{
> + machine_halt();
> +}
> +
> static const struct sysrq_key_op srm_sysrq_reboot_op = {
> - .handler = machine_halt,
> + .handler = sysrq_reboot_handler,
> .help_msg = "reboot(b)",
> .action_msg = "Resetting",
> .enable_mask = SYSRQ_ENABLE_BOOT,
> --
> 2.26.2
>

2020-06-13 00:39:40

by Matt Turner

[permalink] [raw]
Subject: Re: [PATCH] alpha: Fix build around srm_sysrq_reboot_op

On Thu, Jun 11, 2020 at 2:14 AM Joerg Roedel <[email protected]> wrote:
>
> From: Joerg Roedel <[email protected]>
>
> The patch introducing the struct was probably never compile tested,
> because it sets a handler with a wrong function signature. Wrap the
> handler into a functions with the correct signature to fix the build.
>
> Fixes: 0f1c9688a194 ("tty/sysrq: alpha: export and use __sysrq_get_key_op()")
> Cc: Emil Velikov <[email protected]>
> Cc: Guenter Roeck <[email protected]>
> Signed-off-by: Joerg Roedel <[email protected]>
> ---

Thanks, applied.

2020-06-15 19:55:45

by Emil Velikov

[permalink] [raw]
Subject: Re: [PATCH] alpha: Fix build around srm_sysrq_reboot_op

Hi all,

On Thu, 11 Jun 2020 at 10:11, Joerg Roedel <[email protected]> wrote:
>
> From: Joerg Roedel <[email protected]>
>
> The patch introducing the struct was probably never compile tested,
> because it sets a handler with a wrong function signature. Wrap the
> handler into a functions with the correct signature to fix the build.
>
> Fixes: 0f1c9688a194 ("tty/sysrq: alpha: export and use __sysrq_get_key_op()")
> Cc: Emil Velikov <[email protected]>
> Cc: Guenter Roeck <[email protected]>
> Signed-off-by: Joerg Roedel <[email protected]>

Just coming back from 10 offline days and retracing my testing ...
Seems that I've copied the wrong .config.
So a follow-up `make arch/alpha/kernel/setup.o' did not build
anything... yet the command was _successful_.

This is something that should be fixed IMHO - doing the same for
drivers/ (for example drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.o)
results in an obvious audible error.

That said, apologies for the issue. I'll be more thorough and
carefully audit the build logs for future patches.

-Emil