Received: by 10.223.185.116 with SMTP id b49csp6026293wrg; Thu, 8 Mar 2018 00:07:13 -0800 (PST) X-Google-Smtp-Source: AG47ELt7Le9BBOAdv5hTgVUj10pbJ/hNiFbpyOZtaSZyq91KaQDW5hcDR9tATl9G8PB1xYBqR9+f X-Received: by 10.98.212.80 with SMTP id u16mr25568806pfl.58.1520496433574; Thu, 08 Mar 2018 00:07:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496433; cv=none; d=google.com; s=arc-20160816; b=GYWkcXOa92te/3yuDUfCrb8sc01myarBpLwat2COT2BXUqe7CnpUBE/+yB3/JTIlyJ iKFQksZ8zBoFEn0hQ16oRcvM4y4FcwT7WJeKYrsITlJjaYKNGaALiJaJLWxWbMeNZLxk 7cH7gDeytQ2r3Xs9nDxeNPr6XpjcRg+muGItr4WIw98pTap+XffEqjxLjnQf+e67bcGE +QpiX+8yjxy+1/neTb88v3gMx0OeNAriBMDwxm85Ml89sA2fVHSKpRGurhzOgLzzSXm5 kdryPRe01sXM3FHjNpxKS/9LyhiEnWCDLMWRNmlBRjua5Z0BpFPjo5j79dNvvF6wY8Qj QBxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=MO+bfvGDZOQjAlt1G5SDVIXTGY7SP8MqWMcb+HyUtwA=; b=w2f00KfPKT6KARcRzk4+ejbHN1qd36iJ8BvZTMIR6wxBfJXvTCbxQoeqwyamty9xFk S6VT8sf93kBwuhOO1m4svauamvy7ThnB6h6BY7a++aDIGPe43jeuPBZ0F2+nvDHE8JUd dQl79ySZoMwNvk2Enlojhq0uMKhDIGMKb6ckd39HKChOVPjkJqug0jHe/uuFkRoP5Xlm CQDKAhC1iSomY4kAiSazwyUCD2gHhrMpuD+bic1TeoD99RG12wyyhUgtSMW/gHrUmq97 t4pJl426NqtSiYlWlAyMqzpQdg1IGY2zMXimGJVvNq/DyqTRxwtpdtD5ZKEvVcbplmUX X1Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PD53cVkF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19si12640010pgv.195.2018.03.08.00.06.59; Thu, 08 Mar 2018 00:07:13 -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; dkim=pass header.i=@linaro.org header.s=google header.b=PD53cVkF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755182AbeCHIFU (ORCPT + 99 others); Thu, 8 Mar 2018 03:05:20 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32824 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964863AbeCHIB4 (ORCPT ); Thu, 8 Mar 2018 03:01:56 -0500 Received: by mail-wm0-f67.google.com with SMTP id s206so26129674wme.0 for ; Thu, 08 Mar 2018 00:01:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MO+bfvGDZOQjAlt1G5SDVIXTGY7SP8MqWMcb+HyUtwA=; b=PD53cVkFikR/fBSKcXHztM05EquYHeOTozzou3OroK4X0TH16XcD7GVii7QRrCyU0s +VKYCvDsot6h4rcHfSw+ZWUTtwuAmd8TXUXazm+LQ0I+f+yiVLgPpCd8TX8gRSqh4pAd gppEtAtPNFL2SOP/gvf3Ywihay+ODJ/ywBl8g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MO+bfvGDZOQjAlt1G5SDVIXTGY7SP8MqWMcb+HyUtwA=; b=FfhQqHBQv4coPrT8jV5eBJQoYP4vhPwf7I+51MszqZrCirjh53NVRRf5PgT/WKLLU6 yj6ZG6SviQXl6NmtmGxMiCXUqM9qoLn7NFgLItkjZWXnX0mfwoocY1g51QD8w6VRYxqm 1pn6kZFQOdQy4BSBC/AVOlMB95cHYxKoiQ6H+OZZVGuvaGC2kPKWgblXeTyN3zqjQHdC F6zCpIUB8EFvCIh4rDEXBWUHxE95swNGPxSzE4TC9ncliRlMnAYtQ5xU03J4CWjoAEve NL1OoFIbFvwldSMuvDkPa3kDQ4imZSlnEO9zHNg6d+cKNVWLzgF8TCWJO1MKnKxXI5G2 Dt6g== X-Gm-Message-State: AElRT7FZaTDuPfMX8RocYm/9ocBwSuN9oOsHOwtgFWudCJqV3YVmAdyj BXvUTt1m7a19wZWcudnYIHeg2Q== X-Received: by 10.28.35.14 with SMTP id j14mr15097861wmj.43.1520496115187; Thu, 08 Mar 2018 00:01:55 -0800 (PST) Received: from localhost.localdomain ([160.89.73.46]) by smtp.gmail.com with ESMTPSA id e191sm11223361wmg.12.2018.03.08.00.01.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 00:01:54 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Andy Shevchenko , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 02/12] efi/apple-properties: Device core takes care of empty properties Date: Thu, 8 Mar 2018 08:00:10 +0000 Message-Id: <20180308080020.22828-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180308080020.22828-1-ard.biesheuvel@linaro.org> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko 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. Signed-off-by: Andy Shevchenko Reviewed-and-tested-by: Lukas Wunner Signed-off-by: Ard Biesheuvel --- 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); -- 2.15.1