From patchwork Wed Jun 17 22:17:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hon Ching (Vicky) Lo" X-Patchwork-Id: 485734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7892D1404A8 for ; Thu, 18 Jun 2015 08:19:50 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z5LgP-000735-UZ; Wed, 17 Jun 2015 22:19:45 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z5LgP-000730-43 for tpmdd-devel@lists.sourceforge.net; Wed, 17 Jun 2015 22:19:45 +0000 X-ACL-Warn: Received: from e23smtp01.au.ibm.com ([202.81.31.143]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1Z5LgN-0004lD-Tz for tpmdd-devel@lists.sourceforge.net; Wed, 17 Jun 2015 22:19:45 +0000 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 18 Jun 2015 08:19:36 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 18 Jun 2015 08:19:35 +1000 X-Helo: d23dlp02.au.ibm.com X-MailFrom: honclo@linux.vnet.ibm.com X-RcptTo: tpmdd-devel@lists.sourceforge.net Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id F1BE62BB0040 for ; Thu, 18 Jun 2015 08:19:34 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5HMIA7h65208430 for ; Thu, 18 Jun 2015 08:18:18 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5HMHlIl003489 for ; Thu, 18 Jun 2015 08:17:47 +1000 Received: from vtpm2014.ibm.com (sig-9-76-143-100.ibm.com [9.76.143.100]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t5HMHfm4003108; Thu, 18 Jun 2015 08:17:45 +1000 From: "Hon Ching(Vicky) Lo" To: tpmdd-devel@lists.sourceforge.net Date: Wed, 17 Jun 2015 18:17:09 -0400 Message-Id: <1434579429-29449-2-git-send-email-honclo@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1434579429-29449-1-git-send-email-honclo@linux.vnet.ibm.com> References: <1434579429-29449-1-git-send-email-honclo@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061722-1618-0000-0000-00000243EC09 X-Spam-Score: -0.6 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1Z5LgN-0004lD-Tz Cc: Joy Latten , Ashley Lai , linux-kernel@vger.kernel.org, "Hon Ching\(Vicky\) Lo" , Peter Huewe Subject: [tpmdd-devel] [PATCH v4 2/2] TPM: remove unnecessary little endian conversion X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net The base pointer for the event log is allocated in the local kernel (in prom_instantiate_sml()), therefore it is already in the host's endian byte order and requires no conversion. The content of the 'basep' pointer in read_log() stores the base address of the log. This patch ensures that it is correctly implemented. Signed-off-by: Hon Ching(Vicky) Lo Signed-off-by: Joy Latten Reviewed-by: Ashley Lai --- drivers/char/tpm/tpm_of.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c index c002d1b..62a22ce 100644 --- a/drivers/char/tpm/tpm_of.c +++ b/drivers/char/tpm/tpm_of.c @@ -24,7 +24,7 @@ int read_log(struct tpm_bios_log *log) { struct device_node *np; const u32 *sizep; - const __be64 *basep; + const u64 *basep; if (log->bios_event_log != NULL) { pr_err("%s: ERROR - Eventlog already initialized\n", __func__); @@ -63,7 +63,7 @@ int read_log(struct tpm_bios_log *log) log->bios_event_log_end = log->bios_event_log + *sizep; - memcpy(log->bios_event_log, __va(be64_to_cpup(basep)), *sizep); + memcpy(log->bios_event_log, __va(*basep), *sizep); return 0;