[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH v6 3/4] kvm: add kvm_support_device()
From: |
Peter Xu |
Subject: |
Re: [Qemu-arm] [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
[Qemu-arm] [PATCH v6 4/4] arm: implement query-gic-capabilities, Peter Xu, 2016/03/23
Re: [Qemu-arm] [PATCH v6 0/4] ARM: add query-gic-capabilities SMP command, Peter Xu, 2016/03/23
Re: [Qemu-arm] [PATCH v6 0/4] ARM: add query-gic-capabilities SMP command, Andrea Bolognani, 2016/03/23
Re: [Qemu-arm] [Qemu-devel] [PATCH v6 0/4] ARM: add query-gic-capabilities SMP command, Christoffer Dall, 2016/03/23