public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: qat - Drop redundant local variables
@ 2026-02-27 11:53 Thorsten Blum
  2026-02-27 12:21 ` Giovanni Cabiddu
  2026-03-07  5:36 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-02-27 11:53 UTC (permalink / raw)
  To: Giovanni Cabiddu, Herbert Xu, David S. Miller,
	Suman Kumar Chakraborty
  Cc: Thorsten Blum, qat-linux, linux-crypto, linux-kernel

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 <thorsten.blum@linux.dev>
---
 drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c b/drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c
index f31556beed8b..89bfd8761d75 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c
@@ -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;
 
-- 
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: qat - Drop redundant local variables
  2026-02-27 11:53 [PATCH] crypto: qat - Drop redundant local variables Thorsten Blum
@ 2026-02-27 12:21 ` Giovanni Cabiddu
  2026-03-07  5:36 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Giovanni Cabiddu @ 2026-02-27 12:21 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Herbert Xu, David S. Miller, Suman Kumar Chakraborty, qat-linux,
	linux-crypto, linux-kernel

On Fri, Feb 27, 2026 at 12:53:56PM +0100, Thorsten Blum wrote:
> 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 <thorsten.blum@linux.dev>
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>

Regards,

-- 
Giovanni

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: qat - Drop redundant local variables
  2026-02-27 11:53 [PATCH] crypto: qat - Drop redundant local variables Thorsten Blum
  2026-02-27 12:21 ` Giovanni Cabiddu
@ 2026-03-07  5:36 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2026-03-07  5:36 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Giovanni Cabiddu, David S. Miller, Suman Kumar Chakraborty,
	qat-linux, linux-crypto, linux-kernel

On Fri, Feb 27, 2026 at 12:53:56PM +0100, Thorsten Blum wrote:
> 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 <thorsten.blum@linux.dev>
> ---
>  drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-07  5:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 11:53 [PATCH] crypto: qat - Drop redundant local variables Thorsten Blum
2026-02-27 12:21 ` Giovanni Cabiddu
2026-03-07  5:36 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox