Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752333AbdHHWgz (ORCPT ); Tue, 8 Aug 2017 18:36:55 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:48781 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751931AbdHHWgy (ORCPT ); Tue, 8 Aug 2017 18:36:54 -0400 Date: Tue, 8 Aug 2017 16:36:43 -0600 From: Jason Gunthorpe To: Jiandi An Cc: tpmdd-devel@lists.sourceforge.net, peterhuewe@gmx.de, tpmdd@selhorst.net, jarkko.sakkinen@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tpm/tpm_crb: Access locality for only CRB_START method Message-ID: <20170808223643.GD29372@obsidianresearch.com> References: <1502074455-4867-1-git-send-email-anjiandi@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502074455-4867-1-git-send-email-anjiandi@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 660 Lines: 21 On Sun, Aug 06, 2017 at 09:54:15PM -0500, Jiandi An wrote: > static int __maybe_unused crb_go_idle(struct device *dev, struct crb_priv *priv) > { > - if ((priv->flags & CRB_FL_ACPI_START) || > - (priv->flags & CRB_FL_CRB_SMC_START)) > + if (!(priv->flags & CRB_FL_CRB_START)) I think it would be better to have these list the cases where go_idle is known to be required. Less brittle that way.. if ((priv->flags & (CRB_FL_ACPI_START | CRB_FL_CRB_START)) == 0) return 0 > - if (!(priv->flags & CRB_FL_ACPI_START)) { > + if (priv->flags & CRB_FL_CRB_START) { Eg like this now makes more sense, assumming CRB_START is the right test :) Jason