Skip to contentSkip to conversation

x86: pci: xen: Remove unnecessary ‘0’ values from ret

PATCH In review Li zeming 2 participants 2 messages Jun 12, 2024 – Jun 14, 2024

Subsystems (3)
lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 x86: pci: xen: Remove unnecessary ‘0’ values from ret

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

---
 arch/x86/pci/xen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/pci/xen.c +2 -2
index 652cd53e77f6..67cb9dc9b2e7 100644
@@ -267,7 +267,7 @@ static bool __read_mostly pci_seg_supported = true;
 
 static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
-	int ret = 0;
+	int ret;
 	struct msi_desc *msidesc;
 
 	msi_for_each_desc(msidesc, &dev->dev, MSI_DESC_NOTASSOCIATED) {
@@ -353,7 +353,7 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 
 bool xen_initdom_restore_msi(struct pci_dev *dev)
 {
-	int ret = 0;
+	int ret;
 
 	if (!xen_initial_domain())
 		return true;
Signature · 1 line
2.18.2
#1 lore raw
Quoted 1 line · Li zeming

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

While the patch seems fine, this description and the shortlog are confusing.

Signature · 1 line
 i.
Quoted 28 lines
---
 arch/x86/pci/xen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/pci/xen.c +2 -2
index 652cd53e77f6..67cb9dc9b2e7 100644
@@ -267,7 +267,7 @@ static bool __read_mostly pci_seg_supported = true;
 
 static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
-	int ret = 0;
+	int ret;
 	struct msi_desc *msidesc;
 
 	msi_for_each_desc(msidesc, &dev->dev, MSI_DESC_NOTASSOCIATED) {
@@ -353,7 +353,7 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 
 bool xen_initdom_restore_msi(struct pci_dev *dev)
 {
-	int ret = 0;
+	int ret;
 
 	if (!xen_initial_domain())
 		return true;