From: Liu Shixin <liushixin2@huawei.com> To: David Howells <dhowells@redhat.com>, Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>, James Morris <jmorris@namei.org> Cc: keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Liu Shixin <liushixin2@huawei.com> Subject: [PATCH -next] dh key: convert to use be32_add_cpu() Date: Mon, 14 Sep 2020 03:55:42 +0000 [thread overview] Message-ID: <20200914041747.3701948-1-liushixin2@huawei.com> (raw) Convert cpu_to_be32(be32_to_cpu(E1) + E2) to use be32_add_cpu(). Signed-off-by: Liu Shixin <liushixin2@huawei.com> --- security/keys/dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keys/dh.c b/security/keys/dh.c index 1abfa70ed6e1..2635cb8a4561 100644 --- a/security/keys/dh.c +++ b/security/keys/dh.c @@ -186,7 +186,7 @@ static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen, dlen -= h; dst += h; - counter = cpu_to_be32(be32_to_cpu(counter) + 1); + be32_add_cpu(&counter, 1); } return 0; -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Liu Shixin <liushixin2@huawei.com> To: David Howells <dhowells@redhat.com>, Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>, James Morris <jmorris@namei.org> Cc: <keyrings@vger.kernel.org>, <linux-security-module@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Liu Shixin <liushixin2@huawei.com> Subject: [PATCH -next] dh key: convert to use be32_add_cpu() Date: Mon, 14 Sep 2020 12:17:47 +0800 [thread overview] Message-ID: <20200914041747.3701948-1-liushixin2@huawei.com> (raw) Convert cpu_to_be32(be32_to_cpu(E1) + E2) to use be32_add_cpu(). Signed-off-by: Liu Shixin <liushixin2@huawei.com> --- security/keys/dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keys/dh.c b/security/keys/dh.c index 1abfa70ed6e1..2635cb8a4561 100644 --- a/security/keys/dh.c +++ b/security/keys/dh.c @@ -186,7 +186,7 @@ static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen, dlen -= h; dst += h; - counter = cpu_to_be32(be32_to_cpu(counter) + 1); + be32_add_cpu(&counter, 1); } return 0; -- 2.25.1
next reply other threads:[~2020-09-14 3:55 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-14 3:55 Liu Shixin [this message] 2020-09-14 4:17 ` [PATCH -next] dh key: convert to use be32_add_cpu() Liu Shixin
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=20200914041747.3701948-1-liushixin2@huawei.com \ --to=liushixin2@huawei.com \ --cc=dhowells@redhat.com \ --cc=jarkko.sakkinen@linux.intel.com \ --cc=jmorris@namei.org \ --cc=keyrings@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-security-module@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.