[bug report] crypto: aspeed/hash - Add fallback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Herbert Xu,

The patch 508712228696: "crypto: aspeed/hash - Add fallback" from May
13, 2025, leads to the following static checker warning:

	drivers/crypto/aspeed/aspeed-hace-hash.c:453 aspeed_ahash_fallback()
	warn: inconsistent indenting

drivers/crypto/aspeed/aspeed-hace-hash.c
    433 static noinline int aspeed_ahash_fallback(struct ahash_request *req)
    434 {
    435 	struct aspeed_sham_reqctx *rctx = ahash_request_ctx(req);
    436 	HASH_FBREQ_ON_STACK(fbreq, req);
    437 	u8 *state = rctx->buffer;
    438 	struct scatterlist sg[2];
    439 	struct scatterlist *ssg;
    440 	int ret;
    441 
    442 	ssg = scatterwalk_ffwd(sg, req->src, rctx->offset);
    443 	ahash_request_set_crypt(fbreq, ssg, req->result,
    444 				rctx->total - rctx->offset);
    445 
    446 	ret = aspeed_sham_export(req, state) ?:
    447 	      crypto_ahash_import_core(fbreq, state);
    448 
    449 	if (rctx->flags & SHA_FLAGS_FINUP)
    450 		ret = ret ?: crypto_ahash_finup(fbreq);
    451 	else
    452 		ret = ret ?: crypto_ahash_update(fbreq);
--> 453 			     crypto_ahash_export_core(fbreq, state) ?:
    454 			     aspeed_sham_import(req, state);

I guess this should be something like?

	ret = ret ?: crypto_ahash_export_core(fbreq, state);
	ret = ret ?: aspeed_sham_import(req, state);

    455 	HASH_REQUEST_ZERO(fbreq);
    456 	return ret;
    457 }

regards,
dan carpenter




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux