mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Riyan Dhiman <riyandhiman14@gmail.com>
To: dhowells@redhat.com
Cc: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Riyan Dhiman <riyandhiman14@gmail.com>
Subject: [PATCH] KEYS: asymmetric: Calculate size from pointer
Date: Tue,  3 Sep 2024 19:18:31 +0530	[thread overview]
Message-ID: <20240903134831.15448-1-riyandhiman14@gmail.com> (raw)

Calculate the size from pointer instead of
struct to adhere to linux kernel coding style.

Issue reported by checkpatch.

This commit has no functional changes.

Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
---
 crypto/asymmetric_keys/asymmetric_type.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c
index a5da8ccd353e..59b5c6f3ebb4 100644
--- a/crypto/asymmetric_keys/asymmetric_type.c
+++ b/crypto/asymmetric_keys/asymmetric_type.c
@@ -151,7 +151,7 @@ struct asymmetric_key_id *asymmetric_key_generate_id(const void *val_1,
 {
 	struct asymmetric_key_id *kid;
 
-	kid = kmalloc(sizeof(struct asymmetric_key_id) + len_1 + len_2,
+	kid = kmalloc(sizeof(*kid) + len_1 + len_2,
 		      GFP_KERNEL);
 	if (!kid)
 		return ERR_PTR(-ENOMEM);
-- 
2.46.0


                 reply	other threads:[~2024-09-03 13:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240903134831.15448-1-riyandhiman14@gmail.com \
    --to=riyandhiman14@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®