From patchwork Wed Jun 10 01:54:53 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: 482433 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 2E8C414076B for ; Wed, 10 Jun 2015 11:55:27 +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 1Z2VEg-0003ZX-6t; Wed, 10 Jun 2015 01:55:22 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z2VEe-0003ZS-Np for tpmdd-devel@lists.sourceforge.net; Wed, 10 Jun 2015 01:55:20 +0000 X-ACL-Warn: Received: from e28smtp04.in.ibm.com ([122.248.162.4]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1Z2VEd-00053A-Dq for tpmdd-devel@lists.sourceforge.net; Wed, 10 Jun 2015 01:55:20 +0000 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Jun 2015 07:25:11 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp04.in.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 10 Jun 2015 07:25:09 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 0502A3940049 for ; Wed, 10 Jun 2015 07:25:09 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5A1t8d865994888 for ; Wed, 10 Jun 2015 07:25:08 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5A1t7eq007250 for ; Wed, 10 Jun 2015 07:25:08 +0530 Received: from vtpm2014.ibm.com (sig-9-76-201-177.ibm.com [9.76.201.177]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t5A1swhi006570; Wed, 10 Jun 2015 07:25:04 +0530 From: "Hon Ching(Vicky) Lo" To: tpmdd-devel@lists.sourceforge.net Date: Tue, 9 Jun 2015 21:54:53 -0400 Message-Id: <1433901293-29352-2-git-send-email-honclo@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1433901293-29352-1-git-send-email-honclo@linux.vnet.ibm.com> References: <1433901293-29352-1-git-send-email-honclo@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061001-0013-0000-0000-000005A80579 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1Z2VEd-00053A-Dq Cc: Joy Latten , Ashley Lai , linux-kernel@vger.kernel.org, "Hon Ching\(Vicky\) Lo" , Peter Huewe Subject: [tpmdd-devel] [PATCH v2 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;