diff mbox series

RAS/CEC: Fix cec_init prototype

Message ID 20200804161847.825391-1-luca.stefani.ge1@gmail.com (mailing list archive)
State New, archived
Headers show
Series RAS/CEC: Fix cec_init prototype | expand

Commit Message

Luca Stefani Aug. 4, 2020, 4:18 p.m. UTC
* late_initcall expects a function to return an integer

Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
---
 drivers/ras/cec.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Borislav Petkov Aug. 5, 2020, 4:59 a.m. UTC | #1
On Tue, Aug 04, 2020 at 06:18:47PM +0200, Luca Stefani wrote:
> * late_initcall expects a function to return an integer

Please write a proper sentence for a commit message.

> Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
> ---
>  drivers/ras/cec.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
> index 569d9ad2c594..e048e0e3949a 100644
> --- a/drivers/ras/cec.c
> +++ b/drivers/ras/cec.c
> @@ -553,20 +553,20 @@ static struct notifier_block cec_nb = {
>  	.priority	= MCE_PRIO_CEC,
>  };
>  
> -static void __init cec_init(void)
> +static int __init cec_init(void)
>  {
>  	if (ce_arr.disabled)
> -		return;
> +		return 0;

Why 0?

I'm thinking all the cases when the init doesn't succeed should return
!0...
diff mbox series

Patch

diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
index 569d9ad2c594..e048e0e3949a 100644
--- a/drivers/ras/cec.c
+++ b/drivers/ras/cec.c
@@ -553,20 +553,20 @@  static struct notifier_block cec_nb = {
 	.priority	= MCE_PRIO_CEC,
 };
 
-static void __init cec_init(void)
+static int __init cec_init(void)
 {
 	if (ce_arr.disabled)
-		return;
+		return 0;
 
 	ce_arr.array = (void *)get_zeroed_page(GFP_KERNEL);
 	if (!ce_arr.array) {
 		pr_err("Error allocating CE array page!\n");
-		return;
+		return 1;
 	}
 
 	if (create_debugfs_nodes()) {
 		free_page((unsigned long)ce_arr.array);
-		return;
+		return 1;
 	}
 
 	INIT_DELAYED_WORK(&cec_work, cec_work_fn);
@@ -575,6 +575,7 @@  static void __init cec_init(void)
 	mce_register_decode_chain(&cec_nb);
 
 	pr_info("Correctable Errors collector initialized.\n");
+	return 0;
 }
 late_initcall(cec_init);