diff options
author | Jean Delvare <jdelvare@suse.de> | 2013-09-11 17:24:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:58:50 -0400 |
commit | 02d9c47f1bf2304d6482e1e69e00c06791d86908 (patch) | |
tree | f9a1f8cb805d2c44b90e74cd0deac5b298213b31 /drivers/firmware | |
parent | 3d267f24d4c7bcc829ce9daa92e41c3f390c95dd (diff) |
firmware/dmi_scan: fix most checkpatch errors and warnings
Fix all errors and trivial warnings reported by checkpatch for file
drivers/firmware/dmi_scan.c.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Joe Perches <joe@perches.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/dmi_scan.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 9e50cb997a42..5a5ca664f3e7 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -63,7 +63,7 @@ static char * __init dmi_string(const struct dmi_header *dm, u8 s) | |||
63 | if (str != NULL) | 63 | if (str != NULL) |
64 | strcpy(str, bp); | 64 | strcpy(str, bp); |
65 | else | 65 | else |
66 | printk(KERN_ERR "dmi_string: cannot allocate %Zu bytes.\n", len); | 66 | pr_err("dmi_string: cannot allocate %Zu bytes.\n", len); |
67 | 67 | ||
68 | return str; | 68 | return str; |
69 | } | 69 | } |
@@ -140,9 +140,10 @@ int dmi_available; | |||
140 | /* | 140 | /* |
141 | * Save a DMI string | 141 | * Save a DMI string |
142 | */ | 142 | */ |
143 | static void __init dmi_save_ident(const struct dmi_header *dm, int slot, int string) | 143 | static void __init dmi_save_ident(const struct dmi_header *dm, int slot, |
144 | int string) | ||
144 | { | 145 | { |
145 | const char *d = (const char*) dm; | 146 | const char *d = (const char *) dm; |
146 | char *p; | 147 | char *p; |
147 | 148 | ||
148 | if (dmi_ident[slot]) | 149 | if (dmi_ident[slot]) |
@@ -155,9 +156,10 @@ static void __init dmi_save_ident(const struct dmi_header *dm, int slot, int str | |||
155 | dmi_ident[slot] = p; | 156 | dmi_ident[slot] = p; |
156 | } | 157 | } |
157 | 158 | ||
158 | static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int index) | 159 | static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, |
160 | int index) | ||
159 | { | 161 | { |
160 | const u8 *d = (u8*) dm + index; | 162 | const u8 *d = (u8 *) dm + index; |
161 | char *s; | 163 | char *s; |
162 | int is_ff = 1, is_00 = 1, i; | 164 | int is_ff = 1, is_00 = 1, i; |
163 | 165 | ||
@@ -188,12 +190,13 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde | |||
188 | else | 190 | else |
189 | sprintf(s, "%pUB", d); | 191 | sprintf(s, "%pUB", d); |
190 | 192 | ||
191 | dmi_ident[slot] = s; | 193 | dmi_ident[slot] = s; |
192 | } | 194 | } |
193 | 195 | ||
194 | static void __init dmi_save_type(const struct dmi_header *dm, int slot, int index) | 196 | static void __init dmi_save_type(const struct dmi_header *dm, int slot, |
197 | int index) | ||
195 | { | 198 | { |
196 | const u8 *d = (u8*) dm + index; | 199 | const u8 *d = (u8 *) dm + index; |
197 | char *s; | 200 | char *s; |
198 | 201 | ||
199 | if (dmi_ident[slot]) | 202 | if (dmi_ident[slot]) |
@@ -217,7 +220,7 @@ static void __init dmi_save_one_device(int type, const char *name) | |||
217 | 220 | ||
218 | dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1); | 221 | dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1); |
219 | if (!dev) { | 222 | if (!dev) { |
220 | printk(KERN_ERR "dmi_save_one_device: out of memory.\n"); | 223 | pr_err("dmi_save_one_device: out of memory.\n"); |
221 | return; | 224 | return; |
222 | } | 225 | } |
223 | 226 | ||
@@ -256,8 +259,7 @@ static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm) | |||
256 | 259 | ||
257 | dev = dmi_alloc(sizeof(*dev)); | 260 | dev = dmi_alloc(sizeof(*dev)); |
258 | if (!dev) { | 261 | if (!dev) { |
259 | printk(KERN_ERR | 262 | pr_err("dmi_save_oem_strings_devices: out of memory.\n"); |
260 | "dmi_save_oem_strings_devices: out of memory.\n"); | ||
261 | break; | 263 | break; |
262 | } | 264 | } |
263 | 265 | ||
@@ -272,11 +274,11 @@ static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm) | |||
272 | static void __init dmi_save_ipmi_device(const struct dmi_header *dm) | 274 | static void __init dmi_save_ipmi_device(const struct dmi_header *dm) |
273 | { | 275 | { |
274 | struct dmi_device *dev; | 276 | struct dmi_device *dev; |
275 | void * data; | 277 | void *data; |
276 | 278 | ||
277 | data = dmi_alloc(dm->length); | 279 | data = dmi_alloc(dm->length); |
278 | if (data == NULL) { | 280 | if (data == NULL) { |
279 | printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n"); | 281 | pr_err("dmi_save_ipmi_device: out of memory.\n"); |
280 | return; | 282 | return; |
281 | } | 283 | } |
282 | 284 | ||
@@ -284,7 +286,7 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm) | |||
284 | 286 | ||
285 | dev = dmi_alloc(sizeof(*dev)); | 287 | dev = dmi_alloc(sizeof(*dev)); |
286 | if (!dev) { | 288 | if (!dev) { |
287 | printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n"); | 289 | pr_err("dmi_save_ipmi_device: out of memory.\n"); |
288 | return; | 290 | return; |
289 | } | 291 | } |
290 | 292 | ||
@@ -302,7 +304,7 @@ static void __init dmi_save_dev_onboard(int instance, int segment, int bus, | |||
302 | 304 | ||
303 | onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1); | 305 | onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1); |
304 | if (!onboard_dev) { | 306 | if (!onboard_dev) { |
305 | printk(KERN_ERR "dmi_save_dev_onboard: out of memory.\n"); | 307 | pr_err("dmi_save_dev_onboard: out of memory.\n"); |
306 | return; | 308 | return; |
307 | } | 309 | } |
308 | onboard_dev->instance = instance; | 310 | onboard_dev->instance = instance; |
@@ -320,7 +322,7 @@ static void __init dmi_save_dev_onboard(int instance, int segment, int bus, | |||
320 | 322 | ||
321 | static void __init dmi_save_extended_devices(const struct dmi_header *dm) | 323 | static void __init dmi_save_extended_devices(const struct dmi_header *dm) |
322 | { | 324 | { |
323 | const u8 *d = (u8*) dm + 5; | 325 | const u8 *d = (u8 *) dm + 5; |
324 | 326 | ||
325 | /* Skip disabled device */ | 327 | /* Skip disabled device */ |
326 | if ((*d & 0x80) == 0) | 328 | if ((*d & 0x80) == 0) |
@@ -338,7 +340,7 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm) | |||
338 | */ | 340 | */ |
339 | static void __init dmi_decode(const struct dmi_header *dm, void *dummy) | 341 | static void __init dmi_decode(const struct dmi_header *dm, void *dummy) |
340 | { | 342 | { |
341 | switch(dm->type) { | 343 | switch (dm->type) { |
342 | case 0: /* BIOS Information */ | 344 | case 0: /* BIOS Information */ |
343 | dmi_save_ident(dm, DMI_BIOS_VENDOR, 4); | 345 | dmi_save_ident(dm, DMI_BIOS_VENDOR, 4); |
344 | dmi_save_ident(dm, DMI_BIOS_VERSION, 5); | 346 | dmi_save_ident(dm, DMI_BIOS_VERSION, 5); |
@@ -502,8 +504,7 @@ void __init dmi_scan_machine(void) | |||
502 | dmi_available = 1; | 504 | dmi_available = 1; |
503 | goto out; | 505 | goto out; |
504 | } | 506 | } |
505 | } | 507 | } else { |
506 | else { | ||
507 | p = dmi_ioremap(0xF0000, 0x10000); | 508 | p = dmi_ioremap(0xF0000, 0x10000); |
508 | if (p == NULL) | 509 | if (p == NULL) |
509 | goto error; | 510 | goto error; |
@@ -528,7 +529,7 @@ void __init dmi_scan_machine(void) | |||
528 | dmi_iounmap(p, 0x10000); | 529 | dmi_iounmap(p, 0x10000); |
529 | } | 530 | } |
530 | error: | 531 | error: |
531 | printk(KERN_INFO "DMI not present or invalid.\n"); | 532 | pr_info("DMI not present or invalid.\n"); |
532 | out: | 533 | out: |
533 | dmi_initialized = 1; | 534 | dmi_initialized = 1; |
534 | } | 535 | } |
@@ -664,7 +665,7 @@ int dmi_name_in_serial(const char *str) | |||
664 | 665 | ||
665 | /** | 666 | /** |
666 | * dmi_name_in_vendors - Check if string is in the DMI system or board vendor name | 667 | * dmi_name_in_vendors - Check if string is in the DMI system or board vendor name |
667 | * @str: Case sensitive Name | 668 | * @str: Case sensitive Name |
668 | */ | 669 | */ |
669 | int dmi_name_in_vendors(const char *str) | 670 | int dmi_name_in_vendors(const char *str) |
670 | { | 671 | { |
@@ -691,13 +692,13 @@ EXPORT_SYMBOL(dmi_name_in_vendors); | |||
691 | * A new search is initiated by passing %NULL as the @from argument. | 692 | * A new search is initiated by passing %NULL as the @from argument. |
692 | * If @from is not %NULL, searches continue from next device. | 693 | * If @from is not %NULL, searches continue from next device. |
693 | */ | 694 | */ |
694 | const struct dmi_device * dmi_find_device(int type, const char *name, | 695 | const struct dmi_device *dmi_find_device(int type, const char *name, |
695 | const struct dmi_device *from) | 696 | const struct dmi_device *from) |
696 | { | 697 | { |
697 | const struct list_head *head = from ? &from->list : &dmi_devices; | 698 | const struct list_head *head = from ? &from->list : &dmi_devices; |
698 | struct list_head *d; | 699 | struct list_head *d; |
699 | 700 | ||
700 | for(d = head->next; d != &dmi_devices; d = d->next) { | 701 | for (d = head->next; d != &dmi_devices; d = d->next) { |
701 | const struct dmi_device *dev = | 702 | const struct dmi_device *dev = |
702 | list_entry(d, struct dmi_device, list); | 703 | list_entry(d, struct dmi_device, list); |
703 | 704 | ||