Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <18255117159@163.com>
[mani: subject rewording]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20250612161226.950937-1-18255117159@163.com

authored by

Hans Zhang and committed by
Manivannan Sadhasivam
032f05be 19272b37

+7 -7
+7 -7
drivers/pci/controller/dwc/pcie-designware-debugfs.c
··· 814 814 { 815 815 struct dw_pcie *pci = drvdata; 816 816 817 - return (pci->mode == DW_PCIE_EP_TYPE) ? true : false; 817 + return pci->mode == DW_PCIE_EP_TYPE; 818 818 } 819 819 820 820 static bool dw_pcie_ptm_context_valid_visible(void *drvdata) 821 821 { 822 822 struct dw_pcie *pci = drvdata; 823 823 824 - return (pci->mode == DW_PCIE_RC_TYPE) ? true : false; 824 + return pci->mode == DW_PCIE_RC_TYPE; 825 825 } 826 826 827 827 static bool dw_pcie_ptm_local_clock_visible(void *drvdata) ··· 834 834 { 835 835 struct dw_pcie *pci = drvdata; 836 836 837 - return (pci->mode == DW_PCIE_EP_TYPE) ? true : false; 837 + return pci->mode == DW_PCIE_EP_TYPE; 838 838 } 839 839 840 840 static bool dw_pcie_ptm_t1_visible(void *drvdata) 841 841 { 842 842 struct dw_pcie *pci = drvdata; 843 843 844 - return (pci->mode == DW_PCIE_EP_TYPE) ? true : false; 844 + return pci->mode == DW_PCIE_EP_TYPE; 845 845 } 846 846 847 847 static bool dw_pcie_ptm_t2_visible(void *drvdata) 848 848 { 849 849 struct dw_pcie *pci = drvdata; 850 850 851 - return (pci->mode == DW_PCIE_RC_TYPE) ? true : false; 851 + return pci->mode == DW_PCIE_RC_TYPE; 852 852 } 853 853 854 854 static bool dw_pcie_ptm_t3_visible(void *drvdata) 855 855 { 856 856 struct dw_pcie *pci = drvdata; 857 857 858 - return (pci->mode == DW_PCIE_RC_TYPE) ? true : false; 858 + return pci->mode == DW_PCIE_RC_TYPE; 859 859 } 860 860 861 861 static bool dw_pcie_ptm_t4_visible(void *drvdata) 862 862 { 863 863 struct dw_pcie *pci = drvdata; 864 864 865 - return (pci->mode == DW_PCIE_EP_TYPE) ? true : false; 865 + return pci->mode == DW_PCIE_EP_TYPE; 866 866 } 867 867 868 868 const struct pcie_ptm_ops dw_pcie_ptm_ops = {