Skip to contentSkip to conversation

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

PATCH Applied Li kunyu 3 participants 3 messages Nov 13, 2023 – Dec 7, 2023

Subsystems (2)
lore
Share & tools
lore

Li kunyu

author
#0 lore raw

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

rc is assigned first, so it does not need to initialize the assignment.

---
 drivers/misc/ocxl/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/ocxl/main.c +1 -1
index ef73cf35dda2b..658974143c3cc 100644
@@ -7,7 +7,7 @@
 
 static int __init init_ocxl(void)
 {
-	int rc = 0;
+	int rc;
 
 	if (!tlbie_capable)
 		return -EINVAL;
Signature · 1 line
2.18.2
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Li kunyu

rc is assigned first, so it does not need to initialize the assignment.

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:

Quoted 17 lines

---
 drivers/misc/ocxl/main.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/ocxl/main.c +0 -0
index ef73cf35dda2b..658974143c3cc 100644
@@ -7,7 +7,7 @@


 static int __init init_ocxl(void)
 {

drivers/misc/ocxl/main.c +1 -1
-	int rc = 0;
+	int rc;


  if (!tlbie_capable)
  return -EINVAL;

Signature · 2 lines
Andrew Donnellan    OzLabs, ADL Canberra
[email protected]   IBM Australia Limited