Re: [PATCH v3 4/5] KVM: ioeventfd for virtio-ccw devices.

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

 



On Mon, Feb 25, 2013 at 04:27:49PM +0100, Cornelia Huck wrote:
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index f0ced1a..8de3cd7 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -679,11 +679,16 @@ static int
>  kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
>  {
>  	int                       pio = args->flags & KVM_IOEVENTFD_FLAG_PIO;
> -	enum kvm_bus              bus_idx = pio ? KVM_PIO_BUS : KVM_MMIO_BUS;
> +	int                       ccw;
> +	enum kvm_bus              bus_idx;
>  	struct _ioeventfd        *p;
>  	struct eventfd_ctx       *eventfd;
>  	int                       ret;
>  
> +	ccw = args->flags & KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY;
> +	bus_idx = pio ? KVM_PIO_BUS :
> +		ccw ? KVM_VIRTIO_CCW_NOTIFY_BUS :
> +		KVM_MMIO_BUS;
>  	/* must be natural-word sized */
>  	switch (args->len) {
>  	case 1:
> @@ -759,11 +764,16 @@ static int
>  kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
>  {
>  	int                       pio = args->flags & KVM_IOEVENTFD_FLAG_PIO;
> -	enum kvm_bus              bus_idx = pio ? KVM_PIO_BUS : KVM_MMIO_BUS;
> +	int                       ccw;
> +	enum kvm_bus              bus_idx;
>  	struct _ioeventfd        *p, *tmp;
>  	struct eventfd_ctx       *eventfd;
>  	int                       ret = -ENOENT;
>  
> +	ccw = args->flags & KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY;
> +	bus_idx = pio ? KVM_PIO_BUS :
> +		ccw ? KVM_VIRTIO_CCW_NOTIFY_BUS :
> +		KVM_MMIO_BUS;

This is getting pretty convoluted.  Drop of pio and ccw local variables,
replace ?: with an if statement:

if (args->flags & KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY)
	bus_idx = KVM_VIRTIO_CCW_NOTIFY_BUS;
else if (args->flags & KVM_IOEVENTFD_FLAG_PIO)
	bus_idx = KVM_PIO_BUS;
else
	bus_idx = KVM_MMIO_BUS;
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux