crypto: qat - Drop redundant local variables
Subsystems (2)
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'.
Signed-off-by Thorsten Blum <[email protected]>
--- 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
@@ -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
Quoted 6 lines · Thorsten Blum
Return
sysfs_emit()directly and drop 'ret' incap_rem_show().In
cap_rem_store(), use 'ret' when callingset_param_u()instead of assigning it to 'val' first, and remove 'val'.Signed-off-by Thorsten Blum <[email protected]>
Acked-by Giovanni Cabiddu <[email protected]>
Regards,
Signature · 1 line
Giovanni
Herbert Xu
maintainerQuoted 9 lines · Thorsten Blum
Return
sysfs_emit()directly and drop 'ret' incap_rem_show().In
cap_rem_store(), use 'ret' when callingset_param_u()instead of assigning it to 'val' first, and remove 'val'.Signed-off-by Thorsten Blum <[email protected]>--- 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