Skip to contentSkip to conversation

xen/pci: correct comment of pci_device_detect()

PATCH In review Tiejun Chen 2 participants 3 messages May 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/pci: correct comment of pci_device_detect()

Actually we always return 1 if pci device exists.

---
 xen/drivers/passthrough/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/drivers/passthrough/pci.c +1 -1
index 862e20f..6cb6e00 100644
@@ -905,7 +905,7 @@ out:
 }
 
 /*
- * detect pci device, return 0 if it exists, or return 0
+ * detect pci device, return 1 if it exists, or return 0
  */
 int __init pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func)
 {
Signature · 1 line
1.9.1
#1 lore raw

xen/drivers/passthrough/pci.c out: · line 910

Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 20.05.15 at 08:53, <[email protected]> wrote:
xen/drivers/passthrough/pci.c +1 -1
@@ -905,7 +905,7 @@ out:
 }
 
 /*
- * detect pci device, return 0 if it exists, or return 0
+ * detect pci device, return 1 if it exists, or return 0
  */
 int __init pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func)

The comment is pretty pointless, and could go away altogether if the function's return type was switched to bool_t. Care to do such an alternative patch (including replacing some of the callers using == 0 on the result to use ! instead)?

Jan

#2 lore raw
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 20.05.15 at 08:53, <[email protected]> wrote:
xen/drivers/passthrough/pci.c +0 -0
@@ -905,7 +905,7 @@ out:
  }
 
Quoted 8 lines

xen/drivers/passthrough/pci.c out: · line 910

Quoted 5 lines
xen/drivers/passthrough/pci.c +1 -1
  /*
- * detect pci device, return 0 if it exists, or return 0
+ * detect pci device, return 1 if it exists, or return 0
   */
  int __init pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func)

The comment is pretty pointless, and could go away altogether if the function's return type was switched to bool_t. Care to do such

Yeah, I also consider this change initially but I'm not sure if this is necessary. Now I think I'd like to follow this.

Quoted 3 lines

an alternative patch (including replacing some of the callers using == 0 on the result to use ! instead)?

Sure.

Thanks
Tiejun