Skip to content

Commit 032f05b

Browse files
Hans ZhangMani-Sadhasivam
authored andcommitted
PCI: dwc: Simplify the return value of PTM debugfs functions returning bool
Replace redundant ternary conditional expressions with direct boolean returns in PTM debugfs functions. Specifically change this pattern: return (condition) ? true : false; to the simpler: return condition; Signed-off-by: Hans Zhang <[email protected]> [mani: subject rewording] Signed-off-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Frank Li <[email protected]> Reviewed-by: Niklas Cassel <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 19272b3 commit 032f05b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/pci/controller/dwc/pcie-designware-debugfs.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -814,14 +814,14 @@ static bool dw_pcie_ptm_context_update_visible(void *drvdata)
814814
{
815815
struct dw_pcie *pci = drvdata;
816816

817-
return (pci->mode == DW_PCIE_EP_TYPE) ? true : false;
817+
return pci->mode == DW_PCIE_EP_TYPE;
818818
}
819819

820820
static bool dw_pcie_ptm_context_valid_visible(void *drvdata)
821821
{
822822
struct dw_pcie *pci = drvdata;
823823

824-
return (pci->mode == DW_PCIE_RC_TYPE) ? true : false;
824+
return pci->mode == DW_PCIE_RC_TYPE;
825825
}
826826

827827
static bool dw_pcie_ptm_local_clock_visible(void *drvdata)
@@ -834,35 +834,35 @@ static bool dw_pcie_ptm_master_clock_visible(void *drvdata)
834834
{
835835
struct dw_pcie *pci = drvdata;
836836

837-
return (pci->mode == DW_PCIE_EP_TYPE) ? true : false;
837+
return pci->mode == DW_PCIE_EP_TYPE;
838838
}
839839

840840
static bool dw_pcie_ptm_t1_visible(void *drvdata)
841841
{
842842
struct dw_pcie *pci = drvdata;
843843

844-
return (pci->mode == DW_PCIE_EP_TYPE) ? true : false;
844+
return pci->mode == DW_PCIE_EP_TYPE;
845845
}
846846

847847
static bool dw_pcie_ptm_t2_visible(void *drvdata)
848848
{
849849
struct dw_pcie *pci = drvdata;
850850

851-
return (pci->mode == DW_PCIE_RC_TYPE) ? true : false;
851+
return pci->mode == DW_PCIE_RC_TYPE;
852852
}
853853

854854
static bool dw_pcie_ptm_t3_visible(void *drvdata)
855855
{
856856
struct dw_pcie *pci = drvdata;
857857

858-
return (pci->mode == DW_PCIE_RC_TYPE) ? true : false;
858+
return pci->mode == DW_PCIE_RC_TYPE;
859859
}
860860

861861
static bool dw_pcie_ptm_t4_visible(void *drvdata)
862862
{
863863
struct dw_pcie *pci = drvdata;
864864

865-
return (pci->mode == DW_PCIE_EP_TYPE) ? true : false;
865+
return pci->mode == DW_PCIE_EP_TYPE;
866866
}
867867

868868
const struct pcie_ptm_ops dw_pcie_ptm_ops = {

0 commit comments

Comments
 (0)