diff mbox series

misc: ocxl: main: Remove unnecessary ‘0’ values from rc

Message ID 20231113015229.12074-1-kunyu@nfschina.com (mailing list archive)
State Accepted
Commit 29685ea5754f04c84ad443fd7c6869c68f636c26
Headers show
Series misc: ocxl: main: Remove unnecessary ‘0’ values from rc | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 6 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 23 jobs.

Commit Message

Li kunyu Nov. 13, 2023, 1:52 a.m. UTC
rc is assigned first, so it does not need to initialize the assignment.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 drivers/misc/ocxl/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Donnellan Nov. 20, 2023, 4:19 a.m. UTC | #1
On Mon, 2023-11-13 at 09:52 +0800, Li kunyu wrote:
> rc is assigned first, so it does not need to initialize the
> assignment.
> 
> Signed-off-by: Li kunyu <kunyu@nfschina.com>

I don't have strong feelings about whether to get rid of unnecessary
initialisations, but most of the code doesn't do it, so for
consistency:

Acked-by: Andrew Donnellan <ajd@linux.ibm.com>

> ---
>  drivers/misc/ocxl/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/ocxl/main.c b/drivers/misc/ocxl/main.c
> index ef73cf35dda2b..658974143c3cc 100644
> --- a/drivers/misc/ocxl/main.c
> +++ b/drivers/misc/ocxl/main.c
> @@ -7,7 +7,7 @@
>  
>  static int __init init_ocxl(void)
>  {
> -	int rc = 0;
> +	int rc;
>  
>  	if (!tlbie_capable)
>  		return -EINVAL;
Michael Ellerman Dec. 7, 2023, 12:38 p.m. UTC | #2
On Mon, 13 Nov 2023 09:52:29 +0800, Li kunyu wrote:
> rc is assigned first, so it does not need to initialize the assignment.
> 
> 

Applied to powerpc/next.

[1/1] misc: ocxl: main: Remove unnecessary ‘0’ values from rc
      https://git.kernel.org/powerpc/c/29685ea5754f04c84ad443fd7c6869c68f636c26

cheers
diff mbox series

Patch

diff --git a/drivers/misc/ocxl/main.c b/drivers/misc/ocxl/main.c
index ef73cf35dda2b..658974143c3cc 100644
--- a/drivers/misc/ocxl/main.c
+++ b/drivers/misc/ocxl/main.c
@@ -7,7 +7,7 @@ 
 
 static int __init init_ocxl(void)
 {
-	int rc = 0;
+	int rc;
 
 	if (!tlbie_capable)
 		return -EINVAL;