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

Configure Feed

Select the types of activity you want to include in your feed.

crypto: octeontx2 - Simplify multiple return statements

Simplify multiple return statements by directly returning the boolean
expressions.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thorsten Blum and committed by
Herbert Xu
9a7b8741 db4978d2

+10 -24
+10 -24
drivers/crypto/marvell/octeontx2/otx2_cpt_common.h
··· 145 145 146 146 static inline bool is_dev_otx2(struct pci_dev *pdev) 147 147 { 148 - if (pdev->device == OTX2_CPT_PCI_PF_DEVICE_ID || 149 - pdev->device == OTX2_CPT_PCI_VF_DEVICE_ID) 150 - return true; 151 - 152 - return false; 148 + return pdev->device == OTX2_CPT_PCI_PF_DEVICE_ID || 149 + pdev->device == OTX2_CPT_PCI_VF_DEVICE_ID; 153 150 } 154 151 155 152 static inline bool is_dev_cn10ka(struct pci_dev *pdev) ··· 156 159 157 160 static inline bool is_dev_cn10ka_ax(struct pci_dev *pdev) 158 161 { 159 - if (pdev->subsystem_device == CPT_PCI_SUBSYS_DEVID_CN10K_A && 160 - ((pdev->revision & 0xFF) == 4 || (pdev->revision & 0xFF) == 0x50 || 161 - (pdev->revision & 0xff) == 0x51)) 162 - return true; 163 - 164 - return false; 162 + return pdev->subsystem_device == CPT_PCI_SUBSYS_DEVID_CN10K_A && 163 + ((pdev->revision & 0xFF) == 4 || 164 + (pdev->revision & 0xFF) == 0x50 || 165 + (pdev->revision & 0xFF) == 0x51); 165 166 } 166 167 167 168 static inline bool is_dev_cn10kb(struct pci_dev *pdev) ··· 169 174 170 175 static inline bool is_dev_cn10ka_b0(struct pci_dev *pdev) 171 176 { 172 - if (pdev->subsystem_device == CPT_PCI_SUBSYS_DEVID_CN10K_A && 173 - (pdev->revision & 0xFF) == 0x54) 174 - return true; 175 - 176 - return false; 177 + return pdev->subsystem_device == CPT_PCI_SUBSYS_DEVID_CN10K_A && 178 + (pdev->revision & 0xFF) == 0x54; 177 179 } 178 180 179 181 static inline void otx2_cpt_set_hw_caps(struct pci_dev *pdev, ··· 184 192 185 193 static inline bool cpt_is_errata_38550_exists(struct pci_dev *pdev) 186 194 { 187 - if (is_dev_otx2(pdev) || is_dev_cn10ka_ax(pdev)) 188 - return true; 189 - 190 - return false; 195 + return is_dev_otx2(pdev) || is_dev_cn10ka_ax(pdev); 191 196 } 192 197 193 198 static inline bool cpt_feature_sgv2(struct pci_dev *pdev) 194 199 { 195 - if (!is_dev_otx2(pdev) && !is_dev_cn10ka_ax(pdev)) 196 - return true; 197 - 198 - return false; 200 + return !is_dev_otx2(pdev) && !is_dev_cn10ka_ax(pdev); 199 201 } 200 202 201 203 int otx2_cpt_send_ready_msg(struct otx2_mbox *mbox, struct pci_dev *pdev);