lkml.org 
[lkml]   [2017]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 4/5] MIPS: VPE: Improve a size determination in two functions
From
Date
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
\
 
 \ /
  Last update: 2017-05-23 22:56    [W:0.052 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site