Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-mips@linux-mips.org, "Ingo Molnar" <mingo@kernel.org>,
	"James Hogan" <james.hogan@imgtec.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Marcin Nowakowski" <marcin.nowakowski@imgtec.com>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Matt Redfearn" <matt.redfearn@imgtec.com>,
	"Paul Burton" <paul.burton@imgtec.com>,
	"Ralf Bächle" <ralf@linux-mips.org>,
	"Thomas Gleixner" <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 4/5] MIPS: VPE: Improve a size determination in two functions
Date: Tue, 23 May 2017 22:54:18 +0200	[thread overview]
Message-ID: <cf85a732-6901-4eca-2848-71e35e7ce95d@users.sourceforge.net> (raw)
In-Reply-To: <e866716c-5ce4-3658-f944-e310007db127@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 23 May 2017 22:04:17 +0200

Replace the specification of two data structures by pointer dereferences
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/mips/kernel/vpe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 721b1523b740..ed019218496b 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -93,7 +93,7 @@ struct vpe *alloc_vpe(int minor)
 {
 	struct vpe *v;
 
-	v = kzalloc(sizeof(struct vpe), GFP_KERNEL);
+	v = kzalloc(sizeof(*v), GFP_KERNEL);
 	if (v == NULL)
 		goto out;
 
@@ -114,7 +114,7 @@ struct tc *alloc_tc(int index)
 {
 	struct tc *tc;
 
-	tc = kzalloc(sizeof(struct tc), GFP_KERNEL);
+	tc = kzalloc(sizeof(*tc), GFP_KERNEL);
 	if (tc == NULL)
 		goto out;
 
-- 
2.13.0

  parent reply	other threads:[~2017-05-23 20:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 20:50 [PATCH 0/5] MIPS-kernel: Adjustments for some function implementations SF Markus Elfring
2017-05-23 20:51 ` [PATCH 1/5] MIPS: pm-cps: Delete an error message for a failed memory allocation in cps_pm_online_cpu() SF Markus Elfring
2017-05-23 20:52 ` [PATCH 2/5] MIPS: smp-cps: Delete error messages for failed memory allocations in cps_prepare_cpus() SF Markus Elfring
2017-05-23 20:53 ` [PATCH 3/5] MIPS: VPE: Delete an error message for a failed memory allocation in vpe_open() SF Markus Elfring
2017-05-23 20:54 ` SF Markus Elfring [this message]
2017-05-23 20:55 ` [PATCH 5/5] MIPS: VPE: Adjust 13 checks for null pointers SF Markus Elfring
2017-05-23 21:11 ` [PATCH 0/5] MIPS-kernel: Adjustments for some function implementations Joe Perches

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=cf85a732-6901-4eca-2848-71e35e7ce95d@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=james.hogan@imgtec.com \
    --cc=keescook@chromium.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=marcin.nowakowski@imgtec.com \
    --cc=matt.redfearn@imgtec.com \
    --cc=mingo@kernel.org \
    --cc=paul.burton@imgtec.com \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.de \
    --cc=yamada.masahiro@socionext.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