Skip to contentSkip to conversation

blk-pm: Remove unnecessary ‘0’ values from ret

PATCH In review Li zeming 2 participants 2 messages Mar 18, 2024 – Mar 19, 2024 Block layer

lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 blk-pm: Remove unnecessary ‘0’ values from ret

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

---
 block/blk-pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/blk-pm.c +2 -2
index 42e8420747153..c76d5a3169417 100644
@@ -58,10 +58,10 @@ EXPORT_SYMBOL(blk_pm_runtime_init);
  */
 int blk_pre_runtime_suspend(struct request_queue *q)
 {
-	int ret = 0;
+	int ret;
 
 	if (!q->dev)
-		return ret;
+		return 0;
 
 	WARN_ON_ONCE(q->rpm_status != RPM_ACTIVE);
 
Signature · 1 line
2.18.2
#1 lore raw
Quoted 14 lines · Li zeming

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

---
  block/blk-pm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
block/blk-pm.c +0 -0
index 42e8420747153..c76d5a3169417 100644
@@ -58,10 +58,10 @@ EXPORT_SYMBOL(blk_pm_runtime_init);
   */
  int blk_pre_runtime_suspend(struct request_queue *q)

block/blk-pm.c EXPORT_SYMBOL(blk_pm_runtime_init); · line 67

Quoted 10 lines
block/blk-pm.c +2 -2
  {
-	int ret = 0;
+	int ret;
 
  	if (!q->dev)
-		return ret;
+		return 0;
 
  	WARN_ON_ONCE(q->rpm_status != RPM_ACTIVE);
 

I don't see why we need this patch, existing code is fine ...

-ck