[PATCH 4/5] MIPS: VPE: Improve a size determination in two functions
From: SF Markus Elfring
Date: Tue May 23 2017 - 16:54:59 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
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