From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF222C71145 for ; Thu, 24 Aug 2023 10:53:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240870AbjHXKwu convert rfc822-to-8bit (ORCPT ); Thu, 24 Aug 2023 06:52:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240317AbjHXKwW (ORCPT ); Thu, 24 Aug 2023 06:52:22 -0400 Received: from outboundhk.mxmail.xiaomi.com (outboundhk.mxmail.xiaomi.com [207.226.244.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A73510DA; Thu, 24 Aug 2023 03:52:17 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.01,195,1684771200"; d="scan'208";a="88368780" From: sparkhuang To: CC: , , , , , , , , , Subject: Re: Subject: [PATCH] pci/msi: remove redundant calculation in msi_setup_msi_desc Date: Thu, 24 Aug 2023 03:52:14 -0700 Message-ID: <1692874334-39255-1-git-send-email-huangshaobo3@xiaomi.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <87o7iwdd67.ffs@tglx> References: <87o7iwdd67.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.237.8.22] X-ClientProxiedBy: BJ-MBX16.mioffice.cn (10.237.8.136) To BJ-MBX01.mioffice.cn (10.237.8.121) Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 24 Aug 2023 11:04:16 +0200, Thomas Gleixner wrote: > On Thu, Aug 24 2023 at 00:27, huangshaobo3@xiaomi.com wrote: > > On Wed, 23 Aug 2023 16:15:27 +0200, Thomas Gleixner wrote: > >> I'm not seeing what this solves: > > > >> > - if (control & PCI_MSI_FLAGS_64BIT) > >> > + if (desc.pci.msi_attrib.is_64) > > > >> Both variants resolve to a test of a bit and a conditional instruction > >> on the result. It's exactly zero difference in terms of "calculation". > > > >> So all this does is change the memory location to test. Not more not > >> less. It does not generate better code and does not save anything. > > > > It may not be appropriate to write to eliminate duplicate calculations, > > can it be proposed again with clean code? > > What's wrong with the existing code? There is nothing wrong with the current code, using desc.pci.msi_attrib.is_64 does not solve any problems, thank you very much for reviewing comments. Thanks, sparkhuang #/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#