From: "Liang He" <windhl@126.com>
To: "Herbert Xu" <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, linux-crypto@vger.kernel.org
Subject: Re:Re: [PATCH] crypto: Hold the reference returned by of_find_compatible_node
Date: Thu, 30 Jun 2022 14:46:27 +0800 (CST) [thread overview]
Message-ID: <2c070a4e.4403.181b35c6c67.Coremail.windhl@126.com> (raw)
In-Reply-To: <Yr1GCZF/gWBm4zHp@gondor.apana.org.au>
At 2022-06-30 14:43:21, "Herbert Xu" <herbert@gondor.apana.org.au> wrote:
>Liang He <windhl@126.com> wrote:
>> In nx842_pseries_init() and crypto4xx_probe(), we should hold the
>> reference returned by of_find_compatible_node() and use it to call
>> of_node_put to keep refcount balance.
>>
>> Signed-off-by: Liang He <windhl@126.com>
>> ---
>> drivers/crypto/amcc/crypto4xx_core.c | 13 ++++++++-----
>> drivers/crypto/nx/nx-common-pseries.c | 5 ++++-
>> 2 files changed, 12 insertions(+), 6 deletions(-)
>
>Please split this into two patches.
>
OK.
>> diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
>> index 8278d98074e9..169b6a05e752 100644
>> --- a/drivers/crypto/amcc/crypto4xx_core.c
>> +++ b/drivers/crypto/amcc/crypto4xx_core.c
>> @@ -1378,6 +1378,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
>> struct resource res;
>> struct device *dev = &ofdev->dev;
>> struct crypto4xx_core_device *core_dev;
>> + struct device_node *np;
>> u32 pvr;
>> bool is_revb = true;
>>
>> @@ -1385,20 +1386,20 @@ static int crypto4xx_probe(struct platform_device *ofdev)
>> if (rc)
>> return -ENODEV;
>>
>> - if (of_find_compatible_node(NULL, NULL, "amcc,ppc460ex-crypto")) {
>> + if ((np = of_find_compatible_node(NULL, NULL, "amcc,ppc460ex-crypto")) != NULL) {
>
>This is getting awkwardly long. Please change this to
>
> np = ...;
> if (np) {
>
>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
Thanks, Herbert.
I will resend two patches with above change.
Liang
prev parent reply other threads:[~2022-06-30 7:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 7:37 [PATCH] crypto: Hold the reference returned by of_find_compatible_node Liang He
2022-06-30 6:43 ` Herbert Xu
2022-06-30 6:46 ` Liang He [this message]
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=2c070a4e.4403.181b35c6c67.Coremail.windhl@126.com \
--to=windhl@126.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.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;
as well as URLs for NNTP newsgroup(s).