diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2007-10-17 02:26:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:50 -0400 |
commit | f035ac821bf8c36a558471e78c514a96202a1bda (patch) | |
tree | 33e60100ea47c3cb26a8ded359d54ede4a4100a4 | |
parent | 392b7bc13e9e9390bd2deb923d0326c3a50a9a00 (diff) |
doc firmware_sample_firmware_class.c: kmalloc + memset conversion to kzalloc
Documentation/firmware_class/firmware_sample_firmware_class.c | 5246 -> 5211 (-35 bytes)
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | Documentation/firmware_class/firmware_sample_firmware_class.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Documentation/firmware_class/firmware_sample_firmware_class.c b/Documentation/firmware_class/firmware_sample_firmware_class.c index fba943aacf93..2de62854f0e5 100644 --- a/Documentation/firmware_class/firmware_sample_firmware_class.c +++ b/Documentation/firmware_class/firmware_sample_firmware_class.c | |||
@@ -109,15 +109,15 @@ static int fw_setup_class_device(struct class_device *class_dev, | |||
109 | const char *fw_name, | 109 | const char *fw_name, |
110 | struct device *device) | 110 | struct device *device) |
111 | { | 111 | { |
112 | int retval = 0; | 112 | int retval; |
113 | struct firmware_priv *fw_priv = kmalloc(sizeof(struct firmware_priv), | 113 | struct firmware_priv *fw_priv; |
114 | GFP_KERNEL); | ||
115 | 114 | ||
116 | if(!fw_priv){ | 115 | fw_priv = kzalloc(sizeof(struct firmware_priv), GFP_KERNEL); |
116 | if (!fw_priv) { | ||
117 | retval = -ENOMEM; | 117 | retval = -ENOMEM; |
118 | goto out; | 118 | goto out; |
119 | } | 119 | } |
120 | memset(fw_priv, 0, sizeof(*fw_priv)); | 120 | |
121 | memset(class_dev, 0, sizeof(*class_dev)); | 121 | memset(class_dev, 0, sizeof(*class_dev)); |
122 | 122 | ||
123 | strncpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX); | 123 | strncpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX); |