xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/pci: correct comment of pci_device_detect()
@ 2015-05-20  6:53 Tiejun Chen
  2015-05-20 10:06 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Tiejun Chen @ 2015-05-20  6:53 UTC (permalink / raw)
  To: jbeulich; +Cc: xen-devel

Actually we always return 1 if pci device exists.

Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 xen/drivers/passthrough/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 862e20f..6cb6e00 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -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)
 {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/pci: correct comment of pci_device_detect()
  2015-05-20  6:53 [PATCH] xen/pci: correct comment of pci_device_detect() Tiejun Chen
@ 2015-05-20 10:06 ` Jan Beulich
  2015-05-20 10:49   ` Chen, Tiejun
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2015-05-20 10:06 UTC (permalink / raw)
  To: Tiejun Chen; +Cc: xen-devel

>>> On 20.05.15 at 08:53, <tiejun.chen@intel.com> wrote:
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/pci: correct comment of pci_device_detect()
  2015-05-20 10:06 ` Jan Beulich
@ 2015-05-20 10:49   ` Chen, Tiejun
  0 siblings, 0 replies; 3+ messages in thread
From: Chen, Tiejun @ 2015-05-20 10:49 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

On 2015/5/20 18:06, Jan Beulich wrote:
>>>> On 20.05.15 at 08:53, <tiejun.chen@intel.com> wrote:
>> --- a/xen/drivers/passthrough/pci.c
>> +++ b/xen/drivers/passthrough/pci.c
>> @@ -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

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.

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

Sure.

Thanks
Tiejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-20 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20  6:53 [PATCH] xen/pci: correct comment of pci_device_detect() Tiejun Chen
2015-05-20 10:06 ` Jan Beulich
2015-05-20 10:49   ` Chen, Tiejun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).