From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org
Cc: Len Brown <len.brown@intel.com>
Subject: [PATCH] ACPI: update intrd DSDT override console messages
Date: Wed, 6 Feb 2008 20:12:53 -0500 [thread overview]
Message-ID: <1202346773-1893-6-git-send-email-lenb@kernel.org> (raw)
In-Reply-To: <47AA4F9D.7010601@tremplin-utc.net>
From: Len Brown <len.brown@intel.com>
also, address some checkpatch.pl violations
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/osl.c | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 40adf0d..60e80bb 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -326,49 +326,50 @@ struct acpi_table_header *acpi_find_dsdt_initrd(void)
struct kstat stat;
char *ramfs_dsdt_name = "/DSDT.aml";
- printk(KERN_INFO PREFIX "Looking for DSDT in initramfs... ");
+ printk(KERN_INFO PREFIX "Checking initramfs for custom DSDT");
/*
* Never do this at home, only the user-space is allowed to open a file.
- * The clean way would be to use the firmware loader. But this code must be run
- * before there is any userspace available. So we need a static/init firmware
- * infrastructure, which doesn't exist yet...
+ * The clean way would be to use the firmware loader.
+ * But this code must be run before there is any userspace available.
+ * A static/init firmware infrastructure doesn't exist yet...
*/
- if (vfs_stat(ramfs_dsdt_name, &stat) < 0) {
- printk("not found.\n");
+ if (vfs_stat(ramfs_dsdt_name, &stat) < 0)
return ret;
- }
len = stat.size;
/* check especially against empty files */
if (len <= 4) {
- printk("error, file is too small: only %lu bytes.\n", len);
+ printk(KERN_ERR PREFIX "Failed: DSDT only %lu bytes.\n", len);
return ret;
}
firmware_file = filp_open(ramfs_dsdt_name, O_RDONLY, 0);
if (IS_ERR(firmware_file)) {
- printk("error, could not open file %s.\n", ramfs_dsdt_name);
+ printk(KERN_ERR PREFIX "Failed to open %s.\n", ramfs_dsdt_name);
return ret;
}
- dsdt_buffer = ACPI_ALLOCATE(len);
+ dsdt_buffer = kmalloc(len, GFP_ATOMIC);
if (!dsdt_buffer) {
- printk("error when allocating %lu bytes of memory.\n", len);
+ printk(KERN_ERR PREFIX "Failed to allocate %lu bytes.\n", len);
goto err;
}
oldfs = get_fs();
set_fs(KERNEL_DS);
- len2 = vfs_read(firmware_file, (char __user *)dsdt_buffer, len, &firmware_file->f_pos);
+ len2 = vfs_read(firmware_file, (char __user *)dsdt_buffer, len,
+ &firmware_file->f_pos);
set_fs(oldfs);
if (len2 < len) {
- printk("error trying to read %lu bytes from %s.\n", len, ramfs_dsdt_name);
+ printk(KERN_ERR PREFIX "Failed to read %lu bytes from %s.\n",
+ len, ramfs_dsdt_name);
ACPI_FREE(dsdt_buffer);
goto err;
}
- printk("successfully read %lu bytes from %s.\n", len, ramfs_dsdt_name);
+ printk(KERN_INFO PREFIX "Found %lu byte DSDT in %s.\n",
+ len, ramfs_dsdt_name);
ret = dsdt_buffer;
err:
filp_close(firmware_file, NULL);
@@ -392,7 +393,9 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
if ((strncmp(existing_table->signature, "DSDT", 4) == 0) &&
!acpi_no_initrd_override) {
- struct acpi_table_header *initrd_table = acpi_find_dsdt_initrd();
+ struct acpi_table_header *initrd_table;
+
+ initrd_table = acpi_find_dsdt_initrd();
if (initrd_table)
*new_table = initrd_table;
}
--
1.5.4.23.gef5b9
next prev parent reply other threads:[~2008-02-07 1:23 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4798E2A5.6020804@users.sf.net>
[not found] ` <20080125063328.4e3b4752.akpm@linux-foundation.org>
2008-01-26 4:39 ` initrd DSDT override (Re: Feedback about your talk in Rennes France (20080124) : Evolution of the Linux kernel & virtualization technologies) Len Brown
2008-01-30 17:27 ` [PATCH] Override DSDT and SSDTs via initramfs Thomas Renninger
2008-01-30 22:36 ` Éric Piel
2008-01-31 19:17 ` Len Brown
2008-02-01 9:53 ` Thomas Renninger
2008-02-01 11:07 ` Alexey Starikovskiy
2008-02-01 11:29 ` Thomas Renninger
2008-02-02 4:36 ` Len Brown
2008-02-03 17:28 ` [PATCH 0/3] Override DSDT " Éric Piel
2008-02-04 17:53 ` Thomas Renninger
2008-02-04 22:57 ` Éric Piel
2008-02-07 0:15 ` Len Brown
2008-02-07 0:23 ` Éric Piel
2008-02-07 1:07 ` Len Brown
2008-02-07 1:12 ` initrd DSDT override patch series Len Brown
2008-02-07 1:12 ` [PATCH] ACPI: basic initramfs DSDT override support Len Brown
2008-02-07 1:12 ` [PATCH] ACPI: Taint kernel on ACPI table override (format corrected) Len Brown
2008-02-07 1:12 ` [PATCH] ACPI: Add "acpi_no_initrd_override" kernel parameter Len Brown
2008-02-07 1:12 ` [PATCH] ACPI: update DSDT override documentation Len Brown
2008-02-07 1:12 ` Len Brown [this message]
2008-02-03 17:28 ` [PATCH 1/3] The basics of DSDT from initramfs Éric Piel
2008-02-03 17:39 ` Markus Gaugusch
2008-02-03 17:55 ` Éric Piel
2008-02-04 23:04 ` [PATCH 1/3] The basics of DSDT from initramfs (format corrected) Éric Piel
2008-02-06 23:54 ` Len Brown
2008-02-05 14:43 ` [PATCH 1/3] The basics of DSDT from initramfs Thomas Renninger
2008-02-05 14:56 ` Carlos Corbacho
2008-02-03 17:29 ` [PATCH 2/3] Taint kernel on ACPI table override Éric Piel
2008-02-04 23:04 ` [PATCH 2/3] Taint kernel on ACPI table override (format corrected) Éric Piel
2008-02-03 17:29 ` [PATCH 3/3] Add acpi_no_initrd_override kernel parameter Éric Piel
2008-02-04 23:04 ` [PATCH 3/3] Add acpi_no_initrd_override kernel parameter (format corrected) Éric Piel
2008-02-01 10:21 ` [PATCH] Override DSDT and SSDTs via initramfs Thomas Renninger
2008-02-01 10:38 ` Eric Piel
2008-02-07 2:51 ` Len Brown
2008-02-07 7:57 ` Éric Piel
2008-04-18 22:07 ` Philippe Coval
2008-04-18 23:25 ` Eric Piel
2008-02-07 2:49 ` Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1202346773-1893-6-git-send-email-lenb@kernel.org \
--to=lenb@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.