From patchwork Tue Jan 31 18:07:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 9547951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0BAAF6016C for ; Tue, 31 Jan 2017 18:08:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1BBD1FE85 for ; Tue, 31 Jan 2017 18:08:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E689326B41; Tue, 31 Jan 2017 18:08:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 736831FE85 for ; Tue, 31 Jan 2017 18:08:03 +0000 (UTC) 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 1cYcqX-0002Ah-P4; Tue, 31 Jan 2017 18:08:01 +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 1cYcqW-0002AZ-98 for tpmdd-devel@lists.sourceforge.net; Tue, 31 Jan 2017 18:08:00 +0000 X-ACL-Warn: Received: from mga11.intel.com ([192.55.52.93]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1cYcqV-0000La-Gs for tpmdd-devel@lists.sourceforge.net; Tue, 31 Jan 2017 18:08:00 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 31 Jan 2017 10:07:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,315,1477983600"; d="scan'208";a="928646091" Received: from mbrennan-mobl3.ger.corp.intel.com (HELO localhost) ([10.252.3.129]) by orsmga003.jf.intel.com with ESMTP; 31 Jan 2017 10:07:48 -0800 From: Jarkko Sakkinen To: tpmdd-devel@lists.sourceforge.net Date: Tue, 31 Jan 2017 20:07:42 +0200 Message-Id: <20170131180742.28460-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.9.3 X-Headers-End: 1cYcqV-0000La-Gs Cc: open list , linux-security-module@vger.kernel.org Subject: [tpmdd-devel] [PATCH] tpm: fix a sparse error in tpm-interface.c 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 X-Virus-Scanned: ClamAV using ClamSMTP drivers/char/tpm//tpm-interface.c:492:42: warning: bad assignment (-=) to restricted __be32 Fixes: 0883743825e3 ("TPM: sysfs functions consolidation") Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index 423938e..746bc54 100644 --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -489,7 +489,7 @@ ssize_t tpm_getcap(struct tpm_chip *chip, u32 subcap_id, cap_t *cap, tpm_cmd.params.getcap_in.cap = cpu_to_be32(subcap_id); /*subcap field not necessary */ tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(0); - tpm_cmd.header.in.length -= cpu_to_be32(sizeof(__be32)); + tpm_cmd.header.in.length = cpu_to_be32(18); } else { if (subcap_id == TPM_CAP_FLAG_PERM || subcap_id == TPM_CAP_FLAG_VOL)