diff mbox series

[1/4] crypto: qat - move returns to default case

Message ID 20230609163821.6533-2-adam.guerin@intel.com
State Accepted
Commit 038ccc2876686a508d9d46d23ad540a5ad6a969f
Headers show
Series crypto: qat - extend configuration for 4xxx | expand

Commit Message

Adam Guerin June 9, 2023, 4:38 p.m. UTC
Make use of the default statements by changing the pattern:
	switch(condition) {
	case COND_A:
	...
		break;
	case COND_b:
	...
		break;
	}
	return ret;

in

	switch(condition) {
	case COND_A:
	...
		break;
	case COND_b:
	...
		break;
	default:
		return ret;
	}

Signed-off-by: Adam Guerin <adam.guerin@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 .../intel/qat/qat_4xxx/adf_4xxx_hw_data.c     | 20 +++++++++----------
 .../crypto/intel/qat/qat_common/qat_algs.c    |  1 -
 2 files changed, 10 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c b/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c
index d7d5850af703..c961fa6ce5aa 100644
--- a/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c
+++ b/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c
@@ -215,9 +215,9 @@  static u32 get_accel_cap(struct adf_accel_dev *accel_dev)
 		return capabilities_cy;
 	case SVC_DC:
 		return capabilities_dc;
+	default:
+		return 0;
 	}
-
-	return 0;
 }
 
 static enum dev_sku_info get_sku(struct adf_hw_device_data *self)
@@ -232,9 +232,9 @@  static const u32 *adf_get_arbiter_mapping(struct adf_accel_dev *accel_dev)
 		return thrd_to_arb_map_cy;
 	case SVC_DC:
 		return thrd_to_arb_map_dc;
+	default:
+		return NULL;
 	}
-
-	return NULL;
 }
 
 static void get_arb_info(struct arb_info *arb_info)
@@ -319,9 +319,9 @@  static char *uof_get_name_4xxx(struct adf_accel_dev *accel_dev, u32 obj_num)
 		return adf_4xxx_fw_cy_config[obj_num].obj_name;
 	case SVC_DC:
 		return adf_4xxx_fw_dc_config[obj_num].obj_name;
+	default:
+		return NULL;
 	}
-
-	return NULL;
 }
 
 static char *uof_get_name_402xx(struct adf_accel_dev *accel_dev, u32 obj_num)
@@ -331,9 +331,9 @@  static char *uof_get_name_402xx(struct adf_accel_dev *accel_dev, u32 obj_num)
 		return adf_402xx_fw_cy_config[obj_num].obj_name;
 	case SVC_DC:
 		return adf_402xx_fw_dc_config[obj_num].obj_name;
+	default:
+		return NULL;
 	}
-
-	return NULL;
 }
 
 static u32 uof_get_ae_mask(struct adf_accel_dev *accel_dev, u32 obj_num)
@@ -343,9 +343,9 @@  static u32 uof_get_ae_mask(struct adf_accel_dev *accel_dev, u32 obj_num)
 		return adf_4xxx_fw_cy_config[obj_num].ae_mask;
 	case SVC_DC:
 		return adf_4xxx_fw_dc_config[obj_num].ae_mask;
+	default:
+		return 0;
 	}
-
-	return 0;
 }
 
 void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 dev_id)
diff --git a/drivers/crypto/intel/qat/qat_common/qat_algs.c b/drivers/crypto/intel/qat/qat_common/qat_algs.c
index 538dcbfbcd26..3c4bba4a8779 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_algs.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_algs.c
@@ -106,7 +106,6 @@  static int qat_get_inter_state_size(enum icp_qat_hw_auth_algo qat_hash_alg)
 	default:
 		return -EFAULT;
 	}
-	return -EFAULT;
 }
 
 static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,