aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-03-08 03:00:10 -0500
committerIngo Molnar <mingo@kernel.org>2018-03-09 02:58:21 -0500
commit6e98503dba64e721ba839e75dca036266ec0140f (patch)
tree0cb9c434705e4736a97f4932abd85b6a463a09ec
parent6b31a2fa1e8f7bc6c2a474b4a12dad7a145cf83d (diff)
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 <lukas@wunner.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180308080020.22828-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--drivers/firmware/efi/apple-properties.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c
index 9f6bcf173b0e..b9602e0d7b50 100644
--- a/drivers/firmware/efi/apple-properties.c
+++ b/drivers/firmware/efi/apple-properties.c
@@ -52,8 +52,6 @@ struct properties_header {
52 struct dev_header dev_header[0]; 52 struct dev_header dev_header[0];
53}; 53};
54 54
55static u8 one __initdata = 1;
56
57static void __init unmarshal_key_value_pairs(struct dev_header *dev_header, 55static void __init unmarshal_key_value_pairs(struct dev_header *dev_header,
58 struct device *dev, void *ptr, 56 struct device *dev, void *ptr,
59 struct property_entry entry[]) 57 struct property_entry entry[])
@@ -95,14 +93,9 @@ static void __init unmarshal_key_value_pairs(struct dev_header *dev_header,
95 key_len - sizeof(key_len)); 93 key_len - sizeof(key_len));
96 94
97 entry[i].name = key; 95 entry[i].name = key;
98 entry[i].is_array = true;
99 entry[i].length = val_len - sizeof(val_len); 96 entry[i].length = val_len - sizeof(val_len);
97 entry[i].is_array = !!entry[i].length;
100 entry[i].pointer.raw_data = ptr + key_len + sizeof(val_len); 98 entry[i].pointer.raw_data = ptr + key_len + sizeof(val_len);
101 if (!entry[i].length) {
102 /* driver core doesn't accept empty properties */
103 entry[i].length = 1;
104 entry[i].pointer.raw_data = &one;
105 }
106 99
107 if (dump_properties) { 100 if (dump_properties) {
108 dev_info(dev, "property: %s\n", entry[i].name); 101 dev_info(dev, "property: %s\n", entry[i].name);