Re: [PATCH v4 17/17] misc: pci_endpoint_test: Simplify pci_endpoint_test_msi_irq()

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

 



On Thu, Mar 30, 2023 at 05:53:57PM +0900, Damien Le Moal wrote:
> Simplify the code of pci_endpoint_test_msi_irq() by correctly using
> booleans: remove the msix comparison to false as that variable is
> already a boolean, and directly return the result of the comparison of
> the raised interrupt number.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>
> Reviewed-by: Manivannan Sadhasivam <mani@xxxxxxxxxx>
> ---
>  drivers/misc/pci_endpoint_test.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index afd2577261f8..ed4d0ef5e5c3 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -313,21 +313,17 @@ static bool pci_endpoint_test_msi_irq(struct pci_endpoint_test *test,
>  	struct pci_dev *pdev = test->pdev;
>  
>  	pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_TYPE,
> -				 msix == false ? IRQ_TYPE_MSI :
> -				 IRQ_TYPE_MSIX);
> +				 msix ? IRQ_TYPE_MSIX : IRQ_TYPE_MSI);

Nice, much better :)



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux