All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Andy Shevchenko <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, ard.biesheuvel@linaro.org, hpa@zytor.com,
	tglx@linutronix.de, lukas@wunner.de,
	torvalds@linux-foundation.org, andriy.shevchenko@linux.intel.com,
	matt@codeblueprint.co.uk, mingo@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [tip:efi/core] efi/apple-properties: Remove redundant attribute initialization from unmarshal_key_value_pairs()
Date: Fri, 9 Mar 2018 01:11:45 -0800	[thread overview]
Message-ID: <tip-6e98503dba64e721ba839e75dca036266ec0140f@git.kernel.org> (raw)
In-Reply-To: <20180308080020.22828-3-ard.biesheuvel@linaro.org>

Commit-ID:  6e98503dba64e721ba839e75dca036266ec0140f
Gitweb:     https://git.kernel.org/tip/6e98503dba64e721ba839e75dca036266ec0140f
Author:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate: Thu, 8 Mar 2018 08:00:10 +0000
Committer:  Ingo Molnar <mingo@kernel.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@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>
---
 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);

  reply	other threads:[~2018-03-09  9:12 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08  8:00 [GIT PULL 00/12] first batch of EFI changes for v4.17 Ard Biesheuvel
2018-03-08  8:00 ` Ard Biesheuvel
2018-03-08  8:00 ` [PATCH 01/12] efi/arm*: Only register page tables when they exist Ard Biesheuvel
2018-03-09  9:11   ` [tip:efi/core] " tip-bot for Mark Rutland
2018-03-08  8:00 ` [PATCH 02/12] efi/apple-properties: Device core takes care of empty properties Ard Biesheuvel
2018-03-09  9:11   ` tip-bot for Andy Shevchenko [this message]
2018-03-08  8:00 ` [PATCH 03/12] efi/arm*: Stop printing addresses of virtual mappings Ard Biesheuvel
2018-03-09  9:12   ` [tip:efi/core] " tip-bot for Ard Biesheuvel
2018-03-08  8:00 ` [PATCH 04/12] efi/x86: Fix trailing semicolons Ard Biesheuvel
2018-03-08  8:00 ` [PATCH 05/12] efi: arm64: Check whether x18 is preserved by runtime services calls Ard Biesheuvel
2018-03-09  9:12   ` [tip:efi/core] efi/arm64: " tip-bot for Ard Biesheuvel
2018-03-08  8:00 ` [PATCH 06/12] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store Ard Biesheuvel
2018-03-09  7:54   ` Ingo Molnar
2018-03-09  9:13   ` [tip:efi/core] x86/efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store() tip-bot for Jia-Ju Bai
2018-03-08  8:00 ` [PATCH 07/12] efi: Use efi_mm in x86 as well as ARM Ard Biesheuvel
2018-03-09  7:40   ` Ingo Molnar
2018-03-09  8:37     ` Prakhya, Sai Praneeth
2018-03-09  9:56       ` Ard Biesheuvel
2018-03-08  8:00 ` [PATCH 08/12] x86/efi: Replace efi_pgd with efi_mm.pgd Ard Biesheuvel
2018-03-08  8:00 ` [PATCH 09/12] x86/efi: Use efi_switch_mm() rather than manually twiddling with %cr3 Ard Biesheuvel
2018-03-08  8:00 ` [PATCH 10/12] efi: reorder pr_notice() with add_device_randomness() call Ard Biesheuvel
2018-03-09  9:13   ` [tip:efi/core] efi: Reorder " tip-bot for Ard Biesheuvel
2018-03-08  8:00 ` [PATCH 11/12] efi/apple-properties: Use memremap() instead of ioremap() Ard Biesheuvel
2018-03-09  9:14   ` [tip:efi/core] " tip-bot for Andy Shevchenko
2018-03-08  8:00 ` [PATCH 12/12] efi: make const array 'apple' static Ard Biesheuvel
2018-03-08 11:05   ` Joe Perches
2018-03-09  7:43     ` Ard Biesheuvel
2018-03-09  7:44       ` Ard Biesheuvel
2018-03-09  9:37         ` Joe Perches
2018-03-09  7:47   ` Ingo Molnar
2018-03-09  7:52     ` Ard Biesheuvel
2018-03-09  8:04       ` Ingo Molnar
2018-03-09  8:07         ` Ard Biesheuvel
2018-03-09  8:19           ` Ard Biesheuvel
2018-03-09  8:31           ` Ingo Molnar
2018-03-09  8:29     ` Lukas Wunner
2018-03-09  8:33       ` Ard Biesheuvel
2018-03-09  9:16   ` [tip:efi/core] efi: Make " tip-bot for Colin Ian King

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=tip-6e98503dba64e721ba839e75dca036266ec0140f@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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.