Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2054948iog; Sun, 26 Jun 2022 05:39:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tDQory9zPRv2GoapGO2Ga+/eZiGufLnJGfY7nCU4NmhBQMTah53DuNn2wJgTC9Rp/HIEE8 X-Received: by 2002:a17:907:7e8b:b0:726:2c51:b06e with SMTP id qb11-20020a1709077e8b00b007262c51b06emr7743374ejc.129.1656247141260; Sun, 26 Jun 2022 05:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656247141; cv=none; d=google.com; s=arc-20160816; b=j20c8/DQb1+Hu9QIy0mcQ7eB29orP3KQPgGzKIpUeOYhAau+SCYJNJWSJRZwnKgpSw WJSAPLSbGwGocDeOjHFyq1JIwK0DmqE7ZnS35T4Xxh8R9nirRMJjTCYxTU7y0wr9dxK2 oT6jyaW2uE07kWvvmsgJUdlBE6su2Hi0K1RHWZFvsraysJTIliIzeYmjhQ7wZkqteeVD GqgEnTKO6d1Nyw1FbcTWYzb9T1uQ4GNHUMVTYQn2BedJlLQlWDjsF49wTXenWVs+caUH 4kQ2GweDoQm4AP9+17hhSkf5mvDYUwZVnQdwqLblBhn2Pi8AQ86VXYNaxeHw9C01ymme ktmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Xs6FOFA2XZcZBnM/4jcUV2GelnF3mOFoqo0I/BMEwtQ=; b=YjwRVu042FPjzZ8ngfg1PMN07PZt8yd+bKJU7MFVpbPKw5AwVOcMo3tQTzsEQuT7nK jTXAWYFhqrvnYnVTKydWGch9SC2W+A61V56wZ9M739J5rClwfBhYqqWxK92Vn5ssii7x x2XDTAxrrSUL2EwDORC+OLO/cx+fUgZITYQvQAy1vs6T4aACeOUgaloiEVftdllIg856 cBk0xZH4eGATfvwhty3wi0YGbKEz+gtqikBAhMJkkg6roXwT6H+iTnUXvpBq2sBcJ6w6 mnM70Afaossl23FYrlRzfF9xRGeNSImVj4qmQfOZJ9UFJUGV2fZcOKBUWTRy4m+l/9ms IR2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=at3F9hjt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a056402090a00b0042ac9b0221fsi10950795edz.241.2022.06.26.05.38.36; Sun, 26 Jun 2022 05:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=at3F9hjt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbiFZMSi (ORCPT + 99 others); Sun, 26 Jun 2022 08:18:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234299AbiFZMSe (ORCPT ); Sun, 26 Jun 2022 08:18:34 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BDD5DFE6; Sun, 26 Jun 2022 05:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656245898; bh=vCtBe7cGkT2lLAIwjEzVUoD7lfda5lBQRKp9ZNCm2Rc=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=at3F9hjtf/4bdTFG/BmV4eNqL3URKj9khcFgskvkpvabzAavUmcCqCI5a/mIsK+pL bzxNk1nfGCuaCWmtmoaqROi/XH5HLAty6a+TJrjMoLIosJuR4sdxr3s99P2FisOhWU BMCsu5vbGTJgR4zLv97blWxnLZnTYhKEW4+iNrc0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.33] ([46.223.2.248]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWASY-1o8A081Cgc-00Xegt; Sun, 26 Jun 2022 14:18:18 +0200 Subject: Re: [PATCH v6 5/9] tpm, tpm_tis: Only handle supported interrupts To: Jarkko Sakkinen Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, linux@mniewoehner.de, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, l.sanfilippo@kunbus.com, lukas@wunner.de, p.rosenberger@kunbus.com References: <20220621132447.16281-1-LinoSanfilippo@gmx.de> <20220621132447.16281-6-LinoSanfilippo@gmx.de> From: Lino Sanfilippo Message-ID: <6b950660-6a78-f329-39b4-11d585e4959c@gmx.de> Date: Sun, 26 Jun 2022 14:18:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:M740Xfb/qLCEqm++WePlCPkEVPamcZ/7f7h+2btuHpTp37jf1Yn fCZk2v0mYQFd9qSAA5EWRAJ8xDILKzu4v1D3Mrzs9i+Vw9qQ5QySEAekH7l4vmfAzUzxZSc NDmxQHnpENJMKZp9CCDUFlZNuCp4p/OoBq/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Uil ZtaxcKYZKo7lcDNgCb+IxAnp2qgONB6gjz4onAtGdOM1Av6lSUkmhAp38crNqr52w4uM+qZEc ZY03iUpZJg1upyg3H/hQruI1lPRm3h0YpO/BQJ1mzgymcQEbSWvYCxUNLhc47Jw18hsG0ZfaV 2LlyI253lovekFQ/a6oNp8Zutj9eGJQnCgWV3gC5TB9sTOOaN5SlN1w1Q== X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.06.22 at 08:40, Jarkko Sakkinen wrote: > > I would instead mask out bits and write a helper function > taking care of this: > > static u8 tpm_tis_filter_sts_mask(u8 int_mask, u8 sts_mask) > { > struct tpm_tis_data *priv =3D dev_get_drvdata(&chip->dev); > > if (!(int_mask & TPM_INTF_STS_VALID_INT)) > sts_mask &=3D ~TPM_STS_VALID; > > if (!(int_mask & TPM_INTF_DATA_AVAIL_INT)) > sts_mask &=3D ~TPM_STS_DATA_AVAIL; > > if (!(int_mask & TPM_INTF_CMD_READY_INT)) > sts_mask &=3D ~TPM_STS_COMMAND_READY; > > return sts_mask; > } > > Less operations and imho somewhat cleaner structure. > > Add suggested-by if you want. I thought of a helper like this before but then decided to not introduce another function to keep the code changes minimal. But yes, it is indeed cleaner. I will do the change and resubmit the series. Thanks for the review! Regards, Lino