mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 07:22:34 +00:00
efi/apple-properties: Remove redundant attribute initialization from unmarshal_key_value_pairs()
There is no need to artificially supply a property length and fake data if property has type of boolean. Remove redundant piece of data and code. Reviewed-and-tested-by: Lukas Wunner <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
committed by
Ingo Molnar
parent
6b31a2fa1e
commit
6e98503dba
@@ -52,8 +52,6 @@ struct properties_header {
|
||||
struct dev_header dev_header[0];
|
||||
};
|
||||
|
||||
static u8 one __initdata = 1;
|
||||
|
||||
static void __init unmarshal_key_value_pairs(struct dev_header *dev_header,
|
||||
struct device *dev, void *ptr,
|
||||
struct property_entry entry[])
|
||||
@@ -95,14 +93,9 @@ static void __init unmarshal_key_value_pairs(struct dev_header *dev_header,
|
||||
key_len - sizeof(key_len));
|
||||
|
||||
entry[i].name = key;
|
||||
entry[i].is_array = true;
|
||||
entry[i].length = val_len - sizeof(val_len);
|
||||
entry[i].is_array = !!entry[i].length;
|
||||
entry[i].pointer.raw_data = ptr + key_len + sizeof(val_len);
|
||||
if (!entry[i].length) {
|
||||
/* driver core doesn't accept empty properties */
|
||||
entry[i].length = 1;
|
||||
entry[i].pointer.raw_data = &one;
|
||||
}
|
||||
|
||||
if (dump_properties) {
|
||||
dev_info(dev, "property: %s\n", entry[i].name);
|
||||
|
||||
Reference in New Issue
Block a user