From: Tom Lendacky <thomas.lendacky@amd.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Olivia Mackall <olivia@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Jesper Nilsson <jesper.nilsson@axis.com>,
Lars Persson <lars.persson@axis.com>,
"David S. Miller" <davem@davemloft.net>,
John Allen <john.allen@amd.com>,
Srujana Challa <schalla@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>
Cc: linux-crypto@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com
Subject: Re: [PATCH 4/6] crypto: ccp - Constify 'dev_vdata' member
Date: Thu, 6 Nov 2025 14:48:43 -0600 [thread overview]
Message-ID: <2ff82e42-8e17-4bbb-96c8-fbe57dc76966@amd.com> (raw)
In-Reply-To: <20251106-crypto-of-match-v1-4-36b26cd35cff@linaro.org>
On 11/6/25 10:31, Krzysztof Kozlowski wrote:
> sp_device->dev_vdata points to only const data (see 'static const struct
> sp_dev_vdata dev_vdata'), so can be made pointer to const for code
> safety.
>
> Update also sp_get_acpi_version() function which returns this pointer to
> 'pointer to const' for code readability, even though it is not needed.
>
> On the other hand, do not touch similar function sp_get_of_version()
> because it will be immediately removed in next patches.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
> drivers/crypto/ccp/sp-dev.h | 2 +-
> drivers/crypto/ccp/sp-platform.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/crypto/ccp/sp-dev.h b/drivers/crypto/ccp/sp-dev.h
> index 6f9d7063257d..1335a83fe052 100644
> --- a/drivers/crypto/ccp/sp-dev.h
> +++ b/drivers/crypto/ccp/sp-dev.h
> @@ -95,7 +95,7 @@ struct sp_device {
>
> struct device *dev;
>
> - struct sp_dev_vdata *dev_vdata;
> + const struct sp_dev_vdata *dev_vdata;
> unsigned int ord;
> char name[SP_MAX_NAME_LEN];
>
> diff --git a/drivers/crypto/ccp/sp-platform.c b/drivers/crypto/ccp/sp-platform.c
> index 3933cac1694d..de8a8183efdb 100644
> --- a/drivers/crypto/ccp/sp-platform.c
> +++ b/drivers/crypto/ccp/sp-platform.c
> @@ -63,13 +63,13 @@ static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev)
> return NULL;
> }
>
> -static struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev)
> +static const struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev)
> {
> const struct acpi_device_id *match;
>
> match = acpi_match_device(sp_acpi_match, &pdev->dev);
> if (match && match->driver_data)
> - return (struct sp_dev_vdata *)match->driver_data;
> + return (const struct sp_dev_vdata *)match->driver_data;
>
> return NULL;
> }
>
next prev parent reply other threads:[~2025-11-06 20:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 16:31 [PATCH 0/6] crypto/hwrng: Simplify with of_device_get_match_data() Krzysztof Kozlowski
2025-11-06 16:31 ` [PATCH 1/6] hwrng: bcm2835 - Move MODULE_DEVICE_TABLE() to table definition Krzysztof Kozlowski
2025-11-06 20:34 ` Florian Fainelli
2025-11-06 16:31 ` [PATCH 2/6] hwrng: bcm2835 - Simplify with of_device_get_match_data() Krzysztof Kozlowski
2025-11-06 20:44 ` Florian Fainelli
2025-11-06 16:31 ` [PATCH 3/6] crypto: artpec6 " Krzysztof Kozlowski
2025-11-06 19:09 ` Krzysztof Kozlowski
2025-11-06 16:31 ` [PATCH 4/6] crypto: ccp - Constify 'dev_vdata' member Krzysztof Kozlowski
2025-11-06 20:48 ` Tom Lendacky [this message]
2025-11-06 16:31 ` [PATCH 5/6] crypto: ccp - Simplify with of_device_get_match_data() Krzysztof Kozlowski
2025-11-06 20:49 ` Tom Lendacky
2025-11-06 16:31 ` [PATCH 6/6] crypto: cesa " Krzysztof Kozlowski
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=2ff82e42-8e17-4bbb-96c8-fbe57dc76966@amd.com \
--to=thomas.lendacky@amd.com \
--cc=bbhushan2@marvell.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=florian.fainelli@broadcom.com \
--cc=herbert@gondor.apana.org.au \
--cc=jesper.nilsson@axis.com \
--cc=john.allen@amd.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lars.persson@axis.com \
--cc=linux-arm-kernel@axis.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=olivia@selenic.com \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=schalla@marvell.com \
/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®