diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-26 19:29:04 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-26 19:29:04 -0400 |
commit | 0c581415b522267138d807814e526aa7534b9a61 (patch) | |
tree | b41d215210f59ace2ae62b3ee3db1ccf90599a0a /lib | |
parent | afdca01c9821134e71011029a194dd8fcb88c97e (diff) | |
parent | 7702ae0dd9b40930931914866999a2ac9734d3eb (diff) |
Merge branch 'acpi-assorted'
* acpi-assorted:
ACPI / osl: Kill macro INVALID_TABLE().
earlycpio.c: Fix the confusing comment of find_cpio_data().
ACPI / x86: Print Hot-Pluggable Field in SRAT.
ACPI / thermal: Use THERMAL_TRIPS_NONE macro to replace number
ACPI / thermal: Remove unused macros in the driver/acpi/thermal.c
ACPI / thermal: Remove the unused lock of struct acpi_thermal
ACPI / osl: Fix osi_setup_entries[] __initdata attribute location
ACPI / numa: Fix __init attribute location in slit_valid()
ACPI / dock: Fix __init attribute location in find_dock_and_bay()
ACPI / Sleep: Fix incorrect placement of __initdata
ACPI / processor: Fix incorrect placement of __initdata
ACPI / EC: Fix incorrect placement of __initdata
ACPI / scan: Drop unnecessary label from acpi_create_platform_device()
ACPI: Move acpi_bus_get_device() from bus.c to scan.c
ACPI / scan: Allow platform device creation without any IO resources
ACPI: Cleanup sparse warning on acpi_os_initialize1()
platform / thinkpad: Remove deprecated hotkey_report_mode parameter
ACPI: Remove the old /proc/acpi/event interface
Diffstat (limited to 'lib')
-rw-r--r-- | lib/earlycpio.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/earlycpio.c b/lib/earlycpio.c index 7aa7ce250c94..3eb3e4722b8e 100644 --- a/lib/earlycpio.c +++ b/lib/earlycpio.c | |||
@@ -49,22 +49,23 @@ enum cpio_fields { | |||
49 | 49 | ||
50 | /** | 50 | /** |
51 | * cpio_data find_cpio_data - Search for files in an uncompressed cpio | 51 | * cpio_data find_cpio_data - Search for files in an uncompressed cpio |
52 | * @path: The directory to search for, including a slash at the end | 52 | * @path: The directory to search for, including a slash at the end |
53 | * @data: Pointer to the the cpio archive or a header inside | 53 | * @data: Pointer to the the cpio archive or a header inside |
54 | * @len: Remaining length of the cpio based on data pointer | 54 | * @len: Remaining length of the cpio based on data pointer |
55 | * @offset: When a matching file is found, this is the offset to the | 55 | * @nextoff: When a matching file is found, this is the offset from the |
56 | * beginning of the cpio. It can be used to iterate through | 56 | * beginning of the cpio to the beginning of the next file, not the |
57 | * the cpio to find all files inside of a directory path | 57 | * matching file itself. It can be used to iterate through the cpio |
58 | * to find all files inside of a directory path. | ||
58 | * | 59 | * |
59 | * @return: struct cpio_data containing the address, length and | 60 | * @return: struct cpio_data containing the address, length and |
60 | * filename (with the directory path cut off) of the found file. | 61 | * filename (with the directory path cut off) of the found file. |
61 | * If you search for a filename and not for files in a directory, | 62 | * If you search for a filename and not for files in a directory, |
62 | * pass the absolute path of the filename in the cpio and make sure | 63 | * pass the absolute path of the filename in the cpio and make sure |
63 | * the match returned an empty filename string. | 64 | * the match returned an empty filename string. |
64 | */ | 65 | */ |
65 | 66 | ||
66 | struct cpio_data find_cpio_data(const char *path, void *data, | 67 | struct cpio_data find_cpio_data(const char *path, void *data, |
67 | size_t len, long *offset) | 68 | size_t len, long *nextoff) |
68 | { | 69 | { |
69 | const size_t cpio_header_len = 8*C_NFIELDS - 2; | 70 | const size_t cpio_header_len = 8*C_NFIELDS - 2; |
70 | struct cpio_data cd = { NULL, 0, "" }; | 71 | struct cpio_data cd = { NULL, 0, "" }; |
@@ -124,7 +125,7 @@ struct cpio_data find_cpio_data(const char *path, void *data, | |||
124 | if ((ch[C_MODE] & 0170000) == 0100000 && | 125 | if ((ch[C_MODE] & 0170000) == 0100000 && |
125 | ch[C_NAMESIZE] >= mypathsize && | 126 | ch[C_NAMESIZE] >= mypathsize && |
126 | !memcmp(p, path, mypathsize)) { | 127 | !memcmp(p, path, mypathsize)) { |
127 | *offset = (long)nptr - (long)data; | 128 | *nextoff = (long)nptr - (long)data; |
128 | if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) { | 129 | if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) { |
129 | pr_warn( | 130 | pr_warn( |
130 | "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n", | 131 | "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n", |