Skip to contentSkip to conversation

staging: sm750fb: clean-up `else`-blocks

PATCH In review Eric Florin 2 participants 2 messages Apr 18, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: sm750fb: clean-up `else`-blocks

Clean-up else-blocks in hw_sm750_map that occur after if-blocks that terminate function execution.

---
 drivers/staging/sm750fb/sm750_hw.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/sm750fb/sm750_hw.c +2 -4
index 4bc89218c11c..64b199061d14 100644
@@ -55,9 +55,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
 		pr_err("mmio failed\n");
 		ret = -EFAULT;
 		goto exit;
-	} else {
-		pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
 	}
+	pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
 
 	sm750_dev->accel.dprBase = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
 	sm750_dev->accel.dpPortBase = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
@@ -84,9 +83,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
 		pr_err("Map video memory failed\n");
 		ret = -EFAULT;
 		goto exit;
-	} else {
-		pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);
 	}
+	pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);
 exit:
 	return ret;
 }
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 13 lines · Eric Florin

Clean-up else-blocks in hw_sm750_map that occur after if-blocks that terminate function execution.

---
 drivers/staging/sm750fb/sm750_hw.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/sm750fb/sm750_hw.c +0 -0
index 4bc89218c11c..64b199061d14 100644

drivers/staging/sm750fb/sm750_hw.c int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev) · line 59

Quoted 7 lines
drivers/staging/sm750fb/sm750_hw.c +1 -2
@@ -55,9 +55,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
 		pr_err("mmio failed\n");
 		ret = -EFAULT;
 		goto exit;
-	} else {
-		pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
 	}
+	pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);

When drivers work properly, they are "quiet". This driver is not quiet at all. So this really should be a call to dev_dbg(), right?

drivers/staging/sm750fb/sm750_hw.c int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev) · line 87

Quoted 11 lines
drivers/staging/sm750fb/sm750_hw.c +1 -2
 	sm750_dev->accel.dprBase = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
 	sm750_dev->accel.dpPortBase = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
@@ -84,9 +83,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
 		pr_err("Map video memory failed\n");
 		ret = -EFAULT;
 		goto exit;
-	} else {
-		pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);
 	}
+	pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);

Same here.

thanks,

greg k-h