From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbdAaUhZ (ORCPT ); Tue, 31 Jan 2017 15:37:25 -0500 Received: from mga07.intel.com ([134.134.136.100]:29497 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751795AbdAaUhU (ORCPT ); Tue, 31 Jan 2017 15:37:20 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,316,1477983600"; d="scan'208";a="1120340078" Date: Tue, 31 Jan 2017 22:37:14 +0200 From: Jarkko Sakkinen To: Stefan Berger Cc: tpmdd-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tpm: fix a sparse error in tpm-sysfs.c Message-ID: <20170131203714.phz6dpmbyaynbs44@intel.com> References: <1485888239-7727-1-git-send-email-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1485888239-7727-1-git-send-email-stefanb@linux.vnet.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 31, 2017 at 01:43:59PM -0500, Stefan Berger wrote: > drivers/char/tpm/tpm-sysfs.c:161:25: warning: expression using sizeof bool > > Fixes: c659af78eb7b ("tpm: Check size of response before accessing data") > Signed-off-by: Stefan Berger > --- > drivers/char/tpm/tpm.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h > index bff37be..6b4e7aa 100644 > --- a/drivers/char/tpm/tpm.h > +++ b/drivers/char/tpm/tpm.h > @@ -281,7 +281,7 @@ struct permanent_flags_t { > typedef union { > struct permanent_flags_t perm_flags; > struct stclear_flags_t stclear_flags; > - bool owned; > + __u8 owned; > __be32 num_pcrs; > struct tpm_version_t tpm_version; > struct tpm_version_1_2_t tpm_version_1_2; > -- > 2.4.3 A better description would be: The field owned has wrong sized type. This commit fixes the issue. ? /Jarkko