From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Subject: Re: [PATCH V4 4/7] PCI: Unify try slot and bus reset API To: Andy Shevchenko References: <1530214274-21139-1-git-send-email-okaya@codeaurora.org> <1530214274-21139-4-git-send-email-okaya@codeaurora.org> From: Sinan Kaya Message-ID: <9674e845-765c-cc16-654e-21036038f2d5@codeaurora.org> Date: Mon, 2 Jul 2018 16:40:10 -0400 MIME-Version: 1.0 In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Marciniszyn , "open list:VFIO DRIVER" , Alexey Kardashevskiy , linux-pci@vger.kernel.org, Dennis Dalessandro , Alex Williamson , Peter Xu , open list , Jason Gunthorpe , Doug Ledford , Zhenyu Wang , linux-arm-msm@vger.kernel.org, Bjorn Helgaas , linux-arm Mailing List , "open list:HFI1 DRIVER" Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: On 6/29/2018 5:43 PM, Andy Shevchenko wrote: >> +int pci_try_reset_bus(struct pci_dev *pdev) >> +{ >> + bool slot = false; >> + >> + if (!pci_probe_reset_slot(pdev->slot)) >> + slot = true; >> + >> + return slot ? __pci_try_reset_slot(pdev->slot) : >> + __pci_try_reset_bus(pdev->bus); > This can be as simple as > > return pci_probe_reset_slot(pdev->slot) ? > __pci_try_reset_bus(pdev->slot) : __pci_try_reset_slot(pdev->bus); > > done -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel