Skip to contentSkip to conversation

crypto: qat - Drop redundant local variables

PATCH In review Thorsten Blum 3 participants 3 messages Feb 27 – Mar 7

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: qat - Drop redundant local variables

Return sysfs_emit() directly and drop 'ret' in cap_rem_show().

In cap_rem_store(), use 'ret' when calling set_param_u() instead of assigning it to 'val' first, and remove 'val'.

---
 drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c +3 -7
index f31556beed8b..89bfd8761d75 100644
@@ -321,7 +321,7 @@ static ssize_t cap_rem_show(struct device *dev, struct device_attribute *attr,
 {
 	struct adf_rl_interface_data *data;
 	struct adf_accel_dev *accel_dev;
-	int ret, rem_cap;
+	int rem_cap;
 
 	accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
 	if (!accel_dev)
@@ -336,23 +336,19 @@ static ssize_t cap_rem_show(struct device *dev, struct device_attribute *attr,
 	if (rem_cap < 0)
 		return rem_cap;
 
-	ret = sysfs_emit(buf, "%u\n", rem_cap);
-
-	return ret;
+	return sysfs_emit(buf, "%u\n", rem_cap);
 }
 
 static ssize_t cap_rem_store(struct device *dev, struct device_attribute *attr,
 			     const char *buf, size_t count)
 {
-	unsigned int val;
 	int ret;
 
 	ret = sysfs_match_string(rl_services, buf);
 	if (ret < 0)
 		return ret;
 
-	val = ret;
-	ret = set_param_u(dev, CAP_REM_SRV, val);
+	ret = set_param_u(dev, CAP_REM_SRV, ret);
 	if (ret)
 		return ret;
 
Signature · 2 lines
Thorsten Blum <[email protected]>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4
maintainer
#2 lore raw
In reply to Thorsten Blum
Quoted 9 lines · Thorsten Blum

Return sysfs_emit() directly and drop 'ret' in cap_rem_show().

In cap_rem_store(), use 'ret' when calling set_param_u() instead of assigning it to 'val' first, and remove 'val'.

---
 drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt