From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-alpha@vger.kernel.org,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
Matt Turner <mattst88@gmail.com>,
Richard Henderson <rth@twiddle.net>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] alpha-module: Improve a size determination in module_frob_arch_sections()
Date: Thu, 11 May 2017 13:54:42 +0200 [thread overview]
Message-ID: <7e1572c7-8c8e-7b1b-ae56-cbdf1ad23fbc@users.sourceforge.net> (raw)
In-Reply-To: <21258632-0cde-f750-5864-406dc6dfad20@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 11 May 2017 12:54:29 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/alpha/kernel/module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
index 936bc8f89a67..387d9c500e48 100644
--- a/arch/alpha/kernel/module.c
+++ b/arch/alpha/kernel/module.c
@@ -105,5 +105,5 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
}
nsyms = symtab->sh_size / sizeof(Elf64_Sym);
- chains = kcalloc(nsyms, sizeof(struct got_entry), GFP_KERNEL);
+ chains = kcalloc(nsyms, sizeof(*chains), GFP_KERNEL);
if (!chains) {
--
2.12.3
next prev parent reply other threads:[~2017-05-11 11:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-11 11:53 [PATCH 0/2] alpha-module: Adjustments for module_frob_arch_sections() SF Markus Elfring
2017-05-11 11:54 ` SF Markus Elfring [this message]
2017-05-12 5:04 ` [PATCH 1/2] alpha-module: Improve a size determination in module_frob_arch_sections() Al Viro
2017-05-11 11:55 ` [PATCH 2/2] alpha-module: Delete an error message for a failed memory allocation " SF Markus Elfring
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=7e1572c7-8c8e-7b1b-ae56-cbdf1ad23fbc@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=ink@jurassic.park.msu.ru \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=rth@twiddle.net \
/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).