Received: by 10.223.185.111 with SMTP id b44csp77632wrg; Fri, 9 Mar 2018 01:15:09 -0800 (PST) X-Google-Smtp-Source: AG47ELtaeVflwi80tYu8j3hksJTVdjlqcEi3xU4sJSXKAZEBiy7U5hWZKTiqR6DchlBoDzYj1Dh/ X-Received: by 2002:a17:902:538f:: with SMTP id c15-v6mr26102721pli.90.1520586909836; Fri, 09 Mar 2018 01:15:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520586909; cv=none; d=google.com; s=arc-20160816; b=LqqtKE2qc6s1wwqgTf88HTHM6/z2clf8u/KriQBlCtMidjST83dROwS2H+BVu59DpW Ma10HIPg3xNEo+AFdmI2qWs5hokz1PJx9wsu8E3iPSKZXAhCzH1vOYZ24CFvvPidXgJo EThBLQ9USNdc4KmLSkICvIcjy6SgyPABbn3f1bpoR3zLpOKNtiYnSki40ODPRr7Up1Gm V0HqReCzceDPOoEcDp4lcEpix/b7dowJvtZFcS8QzcwEN2GapvT3B26xgUPQb8K4Hx0B nbELtwSulgZuYCrV/EaMMvVqhhJW3fYkGPMBysM/R3A3AmpHefQUYEyY/8Ws+0fgZFwV rCCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=BHU+FXtmOg7pl5J/Ay9kxNQUQPsr+gubhXjseyTkAfU=; b=wjyFJbiTXdgwGV03v1HuzFNurEASXRoOhYvoIcqi23ajBImgfkGkUSSlyUvD0ZkAZa e9CYdAYVneFXCYP7v6ui21GnQi6Lfia7xjYZeE1re03k9ICBQ8Gk2/oSAwlBr/+EpBF7 acv3mi2/bfoy7ptkuxsl/H+4cQ4pgUZd/ms1tSHlVFflEUQ19lRXqT+jBhRZOHifnl/5 6dIHrnj9vuLeQisPujXdzVbZ/m7k6LnI2lNX+9Jxml9diC1REIpj2OySVTWXmOXPsN4p ttk+BM68vq/zbZuAUcdY+bYlHg14gsGYixGBmfRnfSnRhkMs8zbgb71Ft2bHfL8sL1HQ o6Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si445959pge.465.2018.03.09.01.14.55; Fri, 09 Mar 2018 01:15:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751389AbeCIJML (ORCPT + 99 others); Fri, 9 Mar 2018 04:12:11 -0500 Received: from terminus.zytor.com ([198.137.202.136]:33123 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751045AbeCIJMH (ORCPT ); Fri, 9 Mar 2018 04:12:07 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w299Bk5j032393; Fri, 9 Mar 2018 01:11:46 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w299Bj2i032388; Fri, 9 Mar 2018 01:11:45 -0800 Date: Fri, 9 Mar 2018 01:11:45 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Andy Shevchenko Message-ID: 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 Reply-To: torvalds@linux-foundation.org, tglx@linutronix.de, lukas@wunner.de, peterz@infradead.org, hpa@zytor.com, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, matt@codeblueprint.co.uk, mingo@kernel.org, andriy.shevchenko@linux.intel.com In-Reply-To: <20180308080020.22828-3-ard.biesheuvel@linaro.org> References: <20180308080020.22828-3-ard.biesheuvel@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] efi/apple-properties: Remove redundant attribute initialization from unmarshal_key_value_pairs() Git-Commit-ID: 6e98503dba64e721ba839e75dca036266ec0140f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 6e98503dba64e721ba839e75dca036266ec0140f Gitweb: https://git.kernel.org/tip/6e98503dba64e721ba839e75dca036266ec0140f Author: Andy Shevchenko AuthorDate: Thu, 8 Mar 2018 08:00:10 +0000 Committer: Ingo Molnar 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 Signed-off-by: Andy Shevchenko Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Matt Fleming Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180308080020.22828-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar --- 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);