Received: by 10.192.165.156 with SMTP id m28csp1122977imm; Wed, 11 Apr 2018 12:53:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/N4GyaMjaFAOou1smWyFy5MPZGOzFbsT+8dBbD+WX/dND49PYTEuFtsiD4gdv3bukxhVD/ X-Received: by 2002:a17:902:6bc1:: with SMTP id m1-v6mr6372343plt.366.1523476385477; Wed, 11 Apr 2018 12:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523476385; cv=none; d=google.com; s=arc-20160816; b=C3qgSAujh9hcvnBbnJ0pezwtE/c4m+RYIKSKnx3aTYGkp+ElXELyM9NOkNyidXNIPO QMmWaV6JpknWIt2V0nEUvap7WNWviMykaFdXaTXyXPsCgoftZghJNLGja/R+shgzTaOR gaDjkNAIhqCok5I306Zp1n/5Ciw7EeriR4aBScdabuGS6xbraEBzUotvDvQbhSqDGhch IGIpTaHp8Cmd+bbhDXDFJMO7n32boDVclOmZjVS88EmJnxUVuINPs+BJTNV5PIMcWCkU ymgI7kWfc+GU3EjaaifpPgUNN0L4+inSsNoE/7Lcp8LJwWFBChx0bGAy/7FaCWDkenCn IDUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/LGCeOrHOPV/2AyAPLK3lyOdZBx43TMkk67SSFEfSvM=; b=l509r4HkY53qIJCV3T9ILvabDC6XK8GScVk7cETnsbdOro1fp2nsJ6bvX/xaaRvOf9 ZTp6v50rDSztLZysqOE2WjuEeQrBUq5uaJYRP5A10h5NkdJ0IsgcKBbUrD0+IRWHTy7/ 7BeFerwnJzO9XC09veI0hKczYFme5LdWm4M7OWDw3oz2ZEgrFudqpxZvDWG89XPLp9ts fshKIW9qYtML/Yr4rviLVwJJ9LqWNcIF07g5elfextmdvFYLLcV8WmFXC8UWwq/mMGw/ Pg3AG7iWxq3WYotLRkaA3W7yJ1/2S+uEWjYRJ6iE11fbpDqryvSx75C53j2IUQzDM30O U99Q== 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 bc1-v6si1709331plb.689.2018.04.11.12.52.28; Wed, 11 Apr 2018 12:53:05 -0700 (PDT) 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 S1756483AbeDKTtw (ORCPT + 99 others); Wed, 11 Apr 2018 15:49:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36780 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933975AbeDKS6o (ORCPT ); Wed, 11 Apr 2018 14:58:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BC648DD3; Wed, 11 Apr 2018 18:58:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.9 137/310] ACPI: EC: Fix debugfs_create_*() usage Date: Wed, 11 Apr 2018 20:34:36 +0200 Message-Id: <20180411183628.343999234@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Geert Uytterhoeven [ Upstream commit 3522f867c13b63cf62acdf1b8ca5664c549a716a ] acpi_ec.gpe is "unsigned long", hence treating it as "u32" would expose the wrong half on big-endian 64-bit systems. Fix this by changing its type to "u32" and removing the cast, as all other code already uses u32 or sometimes even only u8. Fixes: 1195a098168fcacf (ACPI: Provide /sys/kernel/debug/ec/...) Signed-off-by: Geert Uytterhoeven Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/ec.c | 2 +- drivers/acpi/ec_sys.c | 2 +- drivers/acpi/internal.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1518,7 +1518,7 @@ static int acpi_ec_setup(struct acpi_ec } acpi_handle_info(ec->handle, - "GPE=0x%lx, EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n", + "GPE=0x%x, EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n", ec->gpe, ec->command_addr, ec->data_addr); return ret; } --- a/drivers/acpi/ec_sys.c +++ b/drivers/acpi/ec_sys.c @@ -128,7 +128,7 @@ static int acpi_ec_add_debugfs(struct ac return -ENOMEM; } - if (!debugfs_create_x32("gpe", 0444, dev_dir, (u32 *)&first_ec->gpe)) + if (!debugfs_create_x32("gpe", 0444, dev_dir, &first_ec->gpe)) goto error; if (!debugfs_create_bool("use_global_lock", 0444, dev_dir, &first_ec->global_lock)) --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -158,7 +158,7 @@ static inline void acpi_early_processor_ -------------------------------------------------------------------------- */ struct acpi_ec { acpi_handle handle; - unsigned long gpe; + u32 gpe; unsigned long command_addr; unsigned long data_addr; bool global_lock;