mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
	Thara Gopinath <thara.gopinath@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: qce - Remove return variable and unused assignments
Date: Mon, 2 Mar 2026 13:47:28 +0100	[thread overview]
Message-ID: <68c63578-ff12-4f4a-86a0-212c2a6adfd6@oss.qualcomm.com> (raw)
In-Reply-To: <20260302113453.938998-2-thorsten.blum@linux.dev>

On 3/2/26 12:34 PM, Thorsten Blum wrote:
> In qce_aead_done(), the return variable 'ret' is no longer used - remove
> it. And qce_aead_prepare_dst_buf() jumps directly to 'dst_tbl_free:' on
> error and returns 'sg' - drop the useless 'ret' assignments.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/crypto/qce/aead.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/crypto/qce/aead.c b/drivers/crypto/qce/aead.c
> index 97b56e92ea33..67a87a7d6abd 100644
> --- a/drivers/crypto/qce/aead.c
> +++ b/drivers/crypto/qce/aead.c
> @@ -35,7 +35,6 @@ static void qce_aead_done(void *data)
>  	u32 status;
>  	unsigned int totallen;
>  	unsigned char tag[SHA256_DIGEST_SIZE] = {0};
> -	int ret = 0;
>  
>  	diff_dst = (req->src != req->dst) ? true : false;
>  	dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL;
> @@ -79,8 +78,7 @@ static void qce_aead_done(void *data)
>  	} else if (!IS_CCM(rctx->flags)) {
>  		totallen = req->cryptlen + req->assoclen - ctx->authsize;
>  		scatterwalk_map_and_copy(tag, req->src, totallen, ctx->authsize, 0);
> -		ret = memcmp(result_buf->auth_iv, tag, ctx->authsize);
> -		if (ret) {
> +		if (memcmp(result_buf->auth_iv, tag, ctx->authsize)) {
>  			pr_err("Bad message error\n");
>  			error = -EBADMSG;
>  		}
> @@ -144,16 +142,12 @@ qce_aead_prepare_dst_buf(struct aead_request *req)
>  
>  		sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->adata_sg,
>  				     rctx->assoclen);
> -		if (IS_ERR(sg)) {
> -			ret = PTR_ERR(sg);
> +		if (IS_ERR(sg))
>  			goto dst_tbl_free;

This could be made much better with a DEFINE_FREE()

Konrad

  reply	other threads:[~2026-03-02 12:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 11:34 Thorsten Blum
2026-03-02 12:47 ` Konrad Dybcio [this message]
2026-03-02 14:15   ` Thorsten Blum
2026-03-14  5:07 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68c63578-ff12-4f4a-86a0-212c2a6adfd6@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thara.gopinath@gmail.com \
    --cc=thorsten.blum@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®