lkml.org 
[lkml]   [2017]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/5] fsl_hypervisor: Improve a size determination in fsl_hv_open()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 20 May 2017 19:52:38 +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>
---
drivers/virt/fsl_hypervisor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
index d3eca879a0a8..d1df6c6740f1 100644
--- a/drivers/virt/fsl_hypervisor.c
+++ b/drivers/virt/fsl_hypervisor.c
@@ -659,5 +659,5 @@ static int fsl_hv_open(struct inode *inode, struct file *filp)
unsigned long flags;
int ret = 0;

- dbq = kzalloc(sizeof(struct doorbell_queue), GFP_KERNEL);
+ dbq = kzalloc(sizeof(*dbq), GFP_KERNEL);
if (!dbq) {
--
2.13.0
\
 
 \ /
  Last update: 2017-05-20 21:12    [W:0.237 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site