qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 3/4] kvm: add kvm_support_device() helper fun


From: Peter Xu
Subject: Re: [Qemu-devel] [PATCH v6 3/4] kvm: add kvm_support_device() helper function
Date: Thu, 24 Mar 2016 09:59:10 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

On Wed, Mar 23, 2016 at 06:03:32PM +0300, Sergey Fedorov wrote:
> Yes, but kvm_create_device() returns a file descriptor whereas this
> function is predicative. Personally, I like the convention described in
> chapter 16 of Linux kernel coding style [1]:
> 
>       If the name of a function is an action or an imperative command,
>       the function should return an error-code integer.  If the name
>       is a predicate, the function should return a "succeeded" boolean.

The above is talking about return values. Maybe you were trying to
reference this one as example about add_work() and
pci_dev_present():

    For example, "add work" is a command, and the add_work()
    function returns 0 for success or -EBUSY for failure.  In the
    same way, "PCI device present" is a predicate, and the
    pci_dev_present() function returns 1 if it succeeds in finding a
    matching device or 0 if it doesn't.

Seems make sense. Will take your advice.  Thanks.

-- peterx



reply via email to

[Prev in Thread] Current Thread [Next in Thread]