Commit 02d9c47f authored by Jean Delvare's avatar Jean Delvare Committed by Linus Torvalds

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: default avatarJean Delvare <jdelvare@suse.de>
Cc: Joe Perches <joe@perches.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3d267f24
...@@ -63,7 +63,7 @@ static char * __init dmi_string(const struct dmi_header *dm, u8 s) ...@@ -63,7 +63,7 @@ static char * __init dmi_string(const struct dmi_header *dm, u8 s)
if (str != NULL) if (str != NULL)
strcpy(str, bp); strcpy(str, bp);
else else
printk(KERN_ERR "dmi_string: cannot allocate %Zu bytes.\n", len); pr_err("dmi_string: cannot allocate %Zu bytes.\n", len);
return str; return str;
} }
...@@ -140,9 +140,10 @@ int dmi_available; ...@@ -140,9 +140,10 @@ int dmi_available;
/* /*
* Save a DMI string * Save a DMI string
*/ */
static void __init dmi_save_ident(const struct dmi_header *dm, int slot, int string) static void __init dmi_save_ident(const struct dmi_header *dm, int slot,
int string)
{ {
const char *d = (const char*) dm; const char *d = (const char *) dm;
char *p; char *p;
if (dmi_ident[slot]) if (dmi_ident[slot])
...@@ -155,9 +156,10 @@ static void __init dmi_save_ident(const struct dmi_header *dm, int slot, int str ...@@ -155,9 +156,10 @@ static void __init dmi_save_ident(const struct dmi_header *dm, int slot, int str
dmi_ident[slot] = p; dmi_ident[slot] = p;
} }
static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int index) static void __init dmi_save_uuid(const struct dmi_header *dm, int slot,
int index)
{ {
const u8 *d = (u8*) dm + index; const u8 *d = (u8 *) dm + index;
char *s; char *s;
int is_ff = 1, is_00 = 1, i; int is_ff = 1, is_00 = 1, i;
...@@ -191,9 +193,10 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde ...@@ -191,9 +193,10 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde
dmi_ident[slot] = s; dmi_ident[slot] = s;
} }
static void __init dmi_save_type(const struct dmi_header *dm, int slot, int index) static void __init dmi_save_type(const struct dmi_header *dm, int slot,
int index)
{ {
const u8 *d = (u8*) dm + index; const u8 *d = (u8 *) dm + index;
char *s; char *s;
if (dmi_ident[slot]) if (dmi_ident[slot])
...@@ -217,7 +220,7 @@ static void __init dmi_save_one_device(int type, const char *name) ...@@ -217,7 +220,7 @@ static void __init dmi_save_one_device(int type, const char *name)
dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1); dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1);
if (!dev) { if (!dev) {
printk(KERN_ERR "dmi_save_one_device: out of memory.\n"); pr_err("dmi_save_one_device: out of memory.\n");
return; return;
} }
...@@ -256,8 +259,7 @@ static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm) ...@@ -256,8 +259,7 @@ static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm)
dev = dmi_alloc(sizeof(*dev)); dev = dmi_alloc(sizeof(*dev));
if (!dev) { if (!dev) {
printk(KERN_ERR pr_err("dmi_save_oem_strings_devices: out of memory.\n");
"dmi_save_oem_strings_devices: out of memory.\n");
break; break;
} }
...@@ -272,11 +274,11 @@ static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm) ...@@ -272,11 +274,11 @@ static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm)
static void __init dmi_save_ipmi_device(const struct dmi_header *dm) static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
{ {
struct dmi_device *dev; struct dmi_device *dev;
void * data; void *data;
data = dmi_alloc(dm->length); data = dmi_alloc(dm->length);
if (data == NULL) { if (data == NULL) {
printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n"); pr_err("dmi_save_ipmi_device: out of memory.\n");
return; return;
} }
...@@ -284,7 +286,7 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm) ...@@ -284,7 +286,7 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
dev = dmi_alloc(sizeof(*dev)); dev = dmi_alloc(sizeof(*dev));
if (!dev) { if (!dev) {
printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n"); pr_err("dmi_save_ipmi_device: out of memory.\n");
return; return;
} }
...@@ -302,7 +304,7 @@ static void __init dmi_save_dev_onboard(int instance, int segment, int bus, ...@@ -302,7 +304,7 @@ static void __init dmi_save_dev_onboard(int instance, int segment, int bus,
onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1); onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1);
if (!onboard_dev) { if (!onboard_dev) {
printk(KERN_ERR "dmi_save_dev_onboard: out of memory.\n"); pr_err("dmi_save_dev_onboard: out of memory.\n");
return; return;
} }
onboard_dev->instance = instance; onboard_dev->instance = instance;
...@@ -320,7 +322,7 @@ static void __init dmi_save_dev_onboard(int instance, int segment, int bus, ...@@ -320,7 +322,7 @@ static void __init dmi_save_dev_onboard(int instance, int segment, int bus,
static void __init dmi_save_extended_devices(const struct dmi_header *dm) static void __init dmi_save_extended_devices(const struct dmi_header *dm)
{ {
const u8 *d = (u8*) dm + 5; const u8 *d = (u8 *) dm + 5;
/* Skip disabled device */ /* Skip disabled device */
if ((*d & 0x80) == 0) if ((*d & 0x80) == 0)
...@@ -338,7 +340,7 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm) ...@@ -338,7 +340,7 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm)
*/ */
static void __init dmi_decode(const struct dmi_header *dm, void *dummy) static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
{ {
switch(dm->type) { switch (dm->type) {
case 0: /* BIOS Information */ case 0: /* BIOS Information */
dmi_save_ident(dm, DMI_BIOS_VENDOR, 4); dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
dmi_save_ident(dm, DMI_BIOS_VERSION, 5); dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
...@@ -502,8 +504,7 @@ void __init dmi_scan_machine(void) ...@@ -502,8 +504,7 @@ void __init dmi_scan_machine(void)
dmi_available = 1; dmi_available = 1;
goto out; goto out;
} }
} } else {
else {
p = dmi_ioremap(0xF0000, 0x10000); p = dmi_ioremap(0xF0000, 0x10000);
if (p == NULL) if (p == NULL)
goto error; goto error;
...@@ -528,7 +529,7 @@ void __init dmi_scan_machine(void) ...@@ -528,7 +529,7 @@ void __init dmi_scan_machine(void)
dmi_iounmap(p, 0x10000); dmi_iounmap(p, 0x10000);
} }
error: error:
printk(KERN_INFO "DMI not present or invalid.\n"); pr_info("DMI not present or invalid.\n");
out: out:
dmi_initialized = 1; dmi_initialized = 1;
} }
...@@ -691,13 +692,13 @@ EXPORT_SYMBOL(dmi_name_in_vendors); ...@@ -691,13 +692,13 @@ EXPORT_SYMBOL(dmi_name_in_vendors);
* A new search is initiated by passing %NULL as the @from argument. * A new search is initiated by passing %NULL as the @from argument.
* If @from is not %NULL, searches continue from next device. * If @from is not %NULL, searches continue from next device.
*/ */
const struct dmi_device * dmi_find_device(int type, const char *name, const struct dmi_device *dmi_find_device(int type, const char *name,
const struct dmi_device *from) const struct dmi_device *from)
{ {
const struct list_head *head = from ? &from->list : &dmi_devices; const struct list_head *head = from ? &from->list : &dmi_devices;
struct list_head *d; struct list_head *d;
for(d = head->next; d != &dmi_devices; d = d->next) { for (d = head->next; d != &dmi_devices; d = d->next) {
const struct dmi_device *dev = const struct dmi_device *dev =
list_entry(d, struct dmi_device, list); list_entry(d, struct dmi_device, list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment