From: SF Markus Elfring <elfring@users.sourceforge.net>
To: qemu-devel@nongnu.org, Gabriel Somlo <somlo@cmu.edu>,
"Michael S. Tsirkin" <mst@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [Qemu-devel] [PATCH 2/6] firmware-qemu_fw_cfg: Improve a size determination in fw_cfg_register_file()
Date: Sun, 18 Sep 2016 14:52:47 +0200 [thread overview]
Message-ID: <6517cf5c-06ea-8b97-b2f2-b4e0253ed48f@users.sourceforge.net> (raw)
In-Reply-To: <a736b350-a691-c73b-b8e9-67c0bffb716a@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 18 Sep 2016 10:43:27 +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/firmware/qemu_fw_cfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
index e69653e..a229df6 100644
--- a/drivers/firmware/qemu_fw_cfg.c
+++ b/drivers/firmware/qemu_fw_cfg.c
@@ -458,7 +458,7 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
return -ENOMEM;
/* set file entry information */
- memcpy(&entry->f, f, sizeof(struct fw_cfg_file));
+ memcpy(&entry->f, f, sizeof(*f));
/* register entry under "/sys/firmware/qemu_fw_cfg/by_key/" */
err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype,
--
2.10.0
next prev parent reply other threads:[~2016-09-18 12:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <566ABCD9.1060404@users.sourceforge.net>
2016-09-18 12:48 ` [Qemu-devel] [PATCH 0/6] firmware-qemu_fw_cfg: Fine-tuning for four function implementations SF Markus Elfring
2016-09-18 12:50 ` [Qemu-devel] [PATCH 1/6] firmware-qemu_fw_cfg: Use kmalloc_array() in fw_cfg_register_dir_entries() SF Markus Elfring
2016-09-18 12:52 ` SF Markus Elfring [this message]
2016-09-18 12:53 ` [Qemu-devel] [PATCH 3/6] firmware-qemu_fw_cfg: Rename jump labels in fw_cfg_register_file() SF Markus Elfring
2016-09-18 12:55 ` [Qemu-devel] [PATCH 4/6] firmware-qemu_fw_cfg: Improve a size determination in fw_cfg_build_symlink() SF Markus Elfring
2016-09-18 12:56 ` [Qemu-devel] [PATCH 5/6] firmware-qemu_fw_cfg: Rename jump labels in fw_cfg_sysfs_probe() SF Markus Elfring
2016-09-18 12:58 ` [Qemu-devel] [PATCH 6/6] firmware-qemu_fw_cfg: Move a variable assignment " SF Markus Elfring
2016-09-20 11:09 ` [Qemu-devel] [PATCH 0/6] firmware-qemu_fw_cfg: Fine-tuning for four function implementations Gabriel L. Somlo
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=6517cf5c-06ea-8b97-b2f2-b4e0253ed48f@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=somlo@cmu.edu \
/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;
as well as URLs for NNTP newsgroup(s).