lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-6e98503dba64e721ba839e75dca036266ec0140f@git.kernel.org>
Date:   Fri, 9 Mar 2018 01:11:45 -0800
From:   tip-bot for Andy Shevchenko <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     peterz@...radead.org, ard.biesheuvel@...aro.org, hpa@...or.com,
        tglx@...utronix.de, lukas@...ner.de, torvalds@...ux-foundation.org,
        andriy.shevchenko@...ux.intel.com, matt@...eblueprint.co.uk,
        mingo@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip:efi/core] efi/apple-properties: Remove redundant attribute
 initialization from unmarshal_key_value_pairs()

Commit-ID:  6e98503dba64e721ba839e75dca036266ec0140f
Gitweb:     https://git.kernel.org/tip/6e98503dba64e721ba839e75dca036266ec0140f
Author:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
AuthorDate: Thu, 8 Mar 2018 08:00:10 +0000
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 9 Mar 2018 08:58:21 +0100

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@...ner.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Matt Fleming <matt@...eblueprint.co.uk>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-efi@...r.kernel.org
Link: http://lkml.kernel.org/r/20180308080020.22828-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 drivers/firmware/efi/apple-properties.c | 9 +--------
 1 file changed, 1 insertion(+), 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 {
 	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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ