Subject: Re: linux-next: build failure after merge of the char-misc tree

From: Greg KH <[email-masked]>
Date: Mon, 26 Jun 2023 11:06:14 +0200

On Mon, Jun 26, 2023 at 02:25:37PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the char-misc tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
> 
> drivers/char/bsr.c: In function 'bsr_init':
> drivers/char/bsr.c:301:13: error: 'err' undeclared (first use in this function)
>   301 |         if (err)
>       |             ^~~
> drivers/char/bsr.c:301:13: note: each undeclared identifier is reported only once for each function it appears in
> 
> Caused by commit
> 
>   e55ce9fd3d8f ("bsr: make bsr_class a static const structure")
> 
> I have reverted that commit for today.

Ick, I wonder what is up with the 0-day bot these days, I'm not getting
any reports and it should have caught this...

Anyway, I've applied the patch below to fix this up, thanks for the
report!

greg k-h

--------------

>From adfdaf81f9d48d8618a4d8296567248170fe7bcc Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <[email-masked]>
Date: Mon, 26 Jun 2023 11:03:21 +0200
Subject: [PATCH] bsr: fix build problem with bsr_class static cleanup

In commit e55ce9fd3d8f ("bsr: make bsr_class a static const structure"),
the bsr_init function was converted to handle a static class structure,
but the conversion got a variable name wrong, which caused build errors
so fix that up.

Cc: Arnd Bergmann <[email-masked]>
Cc: Ivan Orlov <[email-masked]>
Reported-by: Stephen Rothwell <[email-masked]>
Link: https://lore.kernel.org/r/[email-masked]
Fixes: e55ce9fd3d8f ("bsr: make bsr_class a static const structure")
Signed-off-by: Greg Kroah-Hartman <[email-masked]>
---
 drivers/char/bsr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 0654f0e6b320..12143854aeac 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -298,7 +298,7 @@ static int __init bsr_init(void)
 		goto out_err;
 
 	ret = class_register(&bsr_class);
-	if (err)
+	if (ret)
 		goto out_err_1;
 
 	ret = alloc_chrdev_region(&bsr_dev, 0, BSR_MAX_DEVS, "bsr");
-- 
2.41.0