Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1485792
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4/6] firmware-qemu_fw_cfg: Improve a size determination in fw_cfg_build_symlink() |
| Date | 2016-09-18 15:00 +0200 |
| Message-ID | <siJRn-8eJ-21@gated-at.bofh.it> (permalink) |
| References | <qEuGl-43C-5@gated-at.bofh.it> <siJHH-8bB-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 18 Sep 2016 14:02:02 +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 a834d01..a4b108a 100644
--- a/drivers/firmware/qemu_fw_cfg.c
+++ b/drivers/firmware/qemu_fw_cfg.c
@@ -399,7 +399,7 @@ static int fw_cfg_build_symlink(struct kset *dir,
dir = to_kset(ko);
} else {
/* create new subdirectory kset */
- subdir = kzalloc(sizeof(struct kset), GFP_KERNEL);
+ subdir = kzalloc(sizeof(*subdir), GFP_KERNEL);
if (!subdir) {
ret = -ENOMEM;
break;
--
2.10.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] firmware-qemu_fw_cfg: Fine-tuning for four function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-18 14:50 +0200 [PATCH 3/6] firmware-qemu_fw_cfg: Rename jump labels in fw_cfg_register_file() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-18 15:00 +0200 [PATCH 6/6] firmware-qemu_fw_cfg: Move a variable assignment in fw_cfg_sysfs_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-18 15:00 +0200 [PATCH 1/6] firmware-qemu_fw_cfg: Use kmalloc_array() in fw_cfg_register_dir_entries() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-18 15:00 +0200 [PATCH 2/6] firmware-qemu_fw_cfg: Improve a size determination in fw_cfg_register_file() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-18 15:00 +0200 [PATCH 4/6] firmware-qemu_fw_cfg: Improve a size determination in fw_cfg_build_symlink() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-18 15:00 +0200 [PATCH 5/6] firmware-qemu_fw_cfg: Rename jump labels in fw_cfg_sysfs_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-18 15:00 +0200 Re: [PATCH 0/6] firmware-qemu_fw_cfg: Fine-tuning for four function implementations "Gabriel L. Somlo" <somlo@cmu.edu> - 2016-09-20 13:40 +0200
csiph-web