Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+24 −23
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static char * __init dmi_string(const struct dmi_header *dm, u8 s)
	if (str != NULL)
		strcpy(str, bp);
	else
		printk(KERN_ERR "dmi_string: cannot allocate %Zu bytes.\n", len);
		pr_err("dmi_string: cannot allocate %Zu bytes.\n", len);

	return str;
}
@@ -140,7 +140,8 @@ int dmi_available;
/*
 *	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;
	char *p;
@@ -155,7 +156,8 @@ static void __init dmi_save_ident(const struct dmi_header *dm, int slot, int str
	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;
	char *s;
@@ -191,7 +193,8 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde
	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;
	char *s;
@@ -217,7 +220,7 @@ static void __init dmi_save_one_device(int type, const char *name)

	dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1);
	if (!dev) {
		printk(KERN_ERR "dmi_save_one_device: out of memory.\n");
		pr_err("dmi_save_one_device: out of memory.\n");
		return;
	}

@@ -256,8 +259,7 @@ static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm)

		dev = dmi_alloc(sizeof(*dev));
		if (!dev) {
			printk(KERN_ERR
			   "dmi_save_oem_strings_devices: out of memory.\n");
			pr_err("dmi_save_oem_strings_devices: out of memory.\n");
			break;
		}

@@ -276,7 +278,7 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)

	data = dmi_alloc(dm->length);
	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;
	}

@@ -284,7 +286,7 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)

	dev = dmi_alloc(sizeof(*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;
	}

@@ -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);
	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;
	}
	onboard_dev->instance = instance;
@@ -502,8 +504,7 @@ void __init dmi_scan_machine(void)
			dmi_available = 1;
			goto out;
		}
	}
	else {
	} else {
		p = dmi_ioremap(0xF0000, 0x10000);
		if (p == NULL)
			goto error;
@@ -528,7 +529,7 @@ void __init dmi_scan_machine(void)
		dmi_iounmap(p, 0x10000);
	}
 error:
	printk(KERN_INFO "DMI not present or invalid.\n");
	pr_info("DMI not present or invalid.\n");
 out:
	dmi_initialized = 1;
}