Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp395005iog; Wed, 29 Jun 2022 02:26:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vPzQYXlOVTMjNGADBwlTbNb45AzykbsV6b9x//uNWvooYpzZotC86fDvQEhP6BWVaXP4lu X-Received: by 2002:a05:6402:847:b0:437:62bd:bbc0 with SMTP id b7-20020a056402084700b0043762bdbbc0mr2864087edz.285.1656494770567; Wed, 29 Jun 2022 02:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656494770; cv=none; d=google.com; s=arc-20160816; b=vjieojoyl+ctE7X8f41i3eCg9mCverEl2GYTQRpoDc2jz9unXcqlFW4v9orRPv3mfv wKhdY7xxkFLIQiEI+IOME2cUma6QFkBRbNg1tTP8E3Iss/q23VlUYH3jYqNIag7UKSRN zy6t7BHjUY2aO8Meug8S0Y6mEuahq+4+056+xWIENoUHFjUX7GcJF4/O70QWmLmarA6o ALx5fYijLaEYSCSMRIQy/7SctCMRXDVTh4OM1KGigAFo2WJ3c8BRR1I5ekXem66IC1cA DmBdIZBJSn2fplJkwYd1hefAAF/0lni94AMDtxMc77+1SHqqgPs5DJcrWam9gAIUiQx4 j25g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=so2LVoScvccWk0DdvjB3TIZ/g8++q5I/tIGwXQbkaJ0=; b=j22lsmPQ+9j9gCmSQeljTSKlgfAsy+FHrB/tR86oD2vyGK6uIre7gR7Pyl8BBz44p3 AGtXLqWaUHB7aJn8pV5IMpL0DLekqIleAlbsAnkEpJS+fAJtaBtuxJy7OGACrVu4ysj+ ReCH5kT81oKtgbdne1JiZ1qN5QJg671yraeDTVVowyPWky5XKOntBs2abv15ay9m0m8M AscLf1CO/DdTqQJCtyXGdZkjZ2O4pUVvDS7NIdHa0gAA6+22wc6hEbK0CRfSmbINZx5N OZvvp3MYfMSOo4Ds6NNs1Ces1Soeay6lNC/azTwTSzm3a8bSK4oc2e+V6JSbms9fLeFi r5VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Z3XzPsNP; 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 bo6-20020a170906d04600b00722e91c126bsi18180888ejb.55.2022.06.29.02.25.45; Wed, 29 Jun 2022 02:26:10 -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=Z3XzPsNP; 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 S232117AbiF2JVL (ORCPT + 99 others); Wed, 29 Jun 2022 05:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbiF2JVK (ORCPT ); Wed, 29 Jun 2022 05:21:10 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3341C369C0; Wed, 29 Jun 2022 02:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656494449; bh=EkAeX5N6w3YtqO8hOxSosvDf28tnCpFaYhH61mIA+xM=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=Z3XzPsNPYg2ClCI0TYTMVAZ3j9MQbwEiFofNt6OMebPo4MwuqH2ZElQFB/nSPB0JM xpYJ9b59N3B9Thw95ysi/UQIE49tQaLoCywMKDZv7+7rdqd6isTA2JtzVaugF2po8Z Tg8NkHQMF/uMnV+mBNGiz8DrjQOvhXRos0Jp5838= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.69] ([46.223.3.23]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MY68d-1o7w5c2P8v-00YOJ2; Wed, 29 Jun 2022 11:20:49 +0200 Message-ID: <4b2b3a2b-fdc0-a684-d4b1-9725e5b87ccb@gmx.de> Date: Wed, 29 Jun 2022 11:20:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v6 5/9] tpm, tpm_tis: Only handle supported interrupts Content-Language: en-US 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> <6b950660-6a78-f329-39b4-11d585e4959c@gmx.de> From: Lino Sanfilippo In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ejJxBMc0f49kRY5+GOJpGpT422gdXQehGqrdv/3iJwEgq3wWlyZ qYetttZl/KJHTWMkWUuVufuUrsRIYQ1PisgVo8zEg2rNHSIOKFHicjDOzEqPyGQXuf6Gwk0 3vhEwzXQO+5ly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YsghizFsj1fYgNqMLueyc zG0TFOcAxIX8knJW8S0BRd/UfeYw/vmjZ3YUPTgrFEHQ/YKPijIcnYMYMScHHUJ/HRDFOGvuV GzhBKHcs0Im4yzPZrpLM821wQP0kIC9mqLxDu0uqLaomQhkM2CT9OfQI0TXVtbXBJvzR5jqES 92ms0ar/dOL7PZ0lAHsBny+fe9WLH5ACdxktQ8yg3ztT71dEZMApWyKhA== 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 28.06.22 01:09, Jarkko Sakkinen wrote: > On Sun, Jun 26, 2022 at 02:18:17PM +0200, Lino Sanfilippo wrote: >> 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 ye= s, >> it is indeed cleaner. I will do the change and resubmit the series. >> >> Thanks for the review! >> >> Regards, >> Lino > > Yeah, please don't add suggested-by, it's such a minor detail > in the overall patch :-) I already created a separate patch which only contains moving the bit chec= ks into the helper function. For that patch the Suggested-by is fully justified IMHO. Thanks for taking time to fix these > glitches and also taking all the feedback into account (and > also being patient). > No problem. Its always good to have some feedback from people that have a = deeper insight into the code. Especially when it is as complex as the TPM subsystem and d= rivers. Best regards, Lino