[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6517cf5c-06ea-8b97-b2f2-b4e0253ed48f@users.sourceforge.net>
Date: Sun, 18 Sep 2016 14:52:47 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: qemu-devel@...gnu.org, Gabriel Somlo <somlo@....edu>,
"Michael S. Tsirkin" <mst@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 2/6] firmware-qemu_fw_cfg: Improve a size determination in
fw_cfg_register_file()
From: Markus Elfring <elfring@...rs.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@...rs.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
Powered by blists - more mailing lists