From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Arnd Bergmann <arnd@arndb.de>, Jan Kara <jack@suse.cz>,
Jesper Nilsson <jesper.nilsson@axis.com>,
Kumar Gala <galak@kernel.crashing.org>,
Lorenzo Stoakes <lstoakes@gmail.com>,
Michal Hocko <mhocko@suse.com>, Timur Tabi <timur@freescale.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/5] fsl_hypervisor: Improve a size determination in fsl_hv_open()
Date: Sat, 20 May 2017 21:10:39 +0200 [thread overview]
Message-ID: <b871da4b-e86d-93b2-859a-4fb6c938075a@users.sourceforge.net> (raw)
In-Reply-To: <38a9b933-4cdc-53e7-0a4c-20f96c57648c@users.sourceforge.net>
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
next prev parent reply other threads:[~2017-05-20 19:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-20 19:08 [PATCH 0/5] fsl_hypervisor: Adjustments for two function implementations SF Markus Elfring
2017-05-20 19:10 ` SF Markus Elfring [this message]
2017-05-20 19:12 ` [PATCH 2/5] fsl_hypervisor: Delete an error message for a failed memory allocation in fsl_hv_open() SF Markus Elfring
2017-05-20 19:13 ` [PATCH 3/5] fsl_hypervisor: Return the success indication only as a constant " SF Markus Elfring
2017-05-20 19:14 ` [PATCH 4/5] fsl_hypervisor: Use kcalloc() in ioctl_memcpy() SF Markus Elfring
2017-05-20 19:16 ` [PATCH 5/5] fsl_hypervisor: Delete error messages for failed memory allocations " 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=b871da4b-e86d-93b2-859a-4fb6c938075a@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=arnd@arndb.de \
--cc=galak@kernel.crashing.org \
--cc=jack@suse.cz \
--cc=jesper.nilsson@axis.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lstoakes@gmail.com \
--cc=mhocko@suse.com \
--cc=timur@freescale.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
Powered by JetHome