Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Jia Jie Ho <jiajie.ho@starfivetech.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Conor Dooley <conor@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	linux-crypto@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH v7 4/4] crypto: starfive - Add hash and HMAC support
Date: Mon, 15 May 2023 12:24:01 +0800	[thread overview]
Message-ID: <ZGGz4YFDMKQThG2x@gondor.apana.org.au> (raw)
In-Reply-To: <2ae2d187-5db7-9207-7846-1a80e87047b2@starfivetech.com>

On Mon, May 15, 2023 at 11:27:35AM +0800, Jia Jie Ho wrote:
>
> I've added COMPILE_TEST in the Kconfig, then ran make W=1, sparse and smatch.
> However it did not produce the error message.

I guess you weren't testing on a 64-bit platform.  BIT(2) is
an unsigned long, so ~BIT(2) is 64-bit long on 64-bit platforms.

You're trying to feed it into writel which takes a 32-bit value,
hence the warning.

If you have to use the BIT macro, then you need to cast the result
to u32:

#define STARFIVE_IE_MASK_HASH_DONE ((u32)BIT(2))

But it's probably a lot clearer if you do it as:

#define STARFIVE_IE_MASK_HASH_DONE 0x4

Cheers,
-- 
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

  reply	other threads:[~2023-05-15  4:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04  7:33 [PATCH v7 0/4] crypto: starfive - Add drivers for crypto engine Jia Jie Ho
2023-05-04  7:33 ` [PATCH v7 1/4] dt-bindings: crypto: Add StarFive crypto module Jia Jie Ho
2023-05-04  7:33 ` [PATCH v7 2/4] crypto: starfive - Add crypto engine support Jia Jie Ho
2023-05-12 10:54   ` Herbert Xu
2023-05-04  7:33 ` [PATCH v7 3/4] riscv: dts: starfive: Add crypto and DMA node for VisionFive 2 Jia Jie Ho
2023-05-04  7:34 ` [PATCH v7 4/4] crypto: starfive - Add hash and HMAC support Jia Jie Ho
2023-05-12 10:55   ` Herbert Xu
2023-05-15  3:27     ` Jia Jie Ho
2023-05-15  4:24       ` Herbert Xu [this message]
2023-05-15  6:04         ` Jia Jie Ho

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=ZGGz4YFDMKQThG2x@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=conor@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jiajie.ho@starfivetech.com \
    --cc=kernel@esmil.dk \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=robh+dt@kernel.org \
    /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