Re: [PATCH -next] vfio/pci: Remove an unnecessary ternary operator

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

 



On Tue, 1 Aug 2023 10:31:22 +0800
Ruan Jinjie <ruanjinjie@xxxxxxxxxx> wrote:

> The true or false judgement of the ternary operator is unnecessary
> in C language semantics. So remove it to clean Code.
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@xxxxxxxxxx>
> ---
>  drivers/vfio/pci/vfio_pci_intrs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
> index cbb4bcbfbf83..2fd018e9b039 100644
> --- a/drivers/vfio/pci/vfio_pci_intrs.c
> +++ b/drivers/vfio/pci/vfio_pci_intrs.c
> @@ -652,7 +652,7 @@ static int vfio_pci_set_msi_trigger(struct vfio_pci_core_device *vdev,
>  {
>  	struct vfio_pci_irq_ctx *ctx;
>  	unsigned int i;
> -	bool msix = (index == VFIO_PCI_MSIX_IRQ_INDEX) ? true : false;
> +	bool msix = index == VFIO_PCI_MSIX_IRQ_INDEX;

Perhaps not strictly required, but this really looks like it should keep
the parens around the test.  Thanks,

Alex

>  
>  	if (irq_is(vdev, index) && !count && (flags & VFIO_IRQ_SET_DATA_NONE)) {
>  		vfio_msi_disable(vdev, msix);




[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