Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1065840pxb; Wed, 6 Oct 2021 23:22:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXYoxyO78PZlfzV0Hb2IkiglAD4LXX5/S7TF0TyJp5JSQzUb/8p9VHcNDBPoK2FFi2go4e X-Received: by 2002:a17:906:b303:: with SMTP id n3mr3220410ejz.267.1633587748057; Wed, 06 Oct 2021 23:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633587748; cv=none; d=google.com; s=arc-20160816; b=Wz1L9CykWpSma021YxxqN/10/rlTZARuIH0B0GOI15eYT7WrMsHCFm1SEAKgOaqjKT z9SBukKm2LWn5oWvyCBZHiW4GGSbMMIC7mjdfdkHKCPZM6qC5CokbPZe1WrpARbvOb0c 3ivT5IXjKVfyvgTR5ip8rVajNTYey0qepnNHfBfHG2oZ426NmQlNUv9EH1E8gGW9TMXM t3/3lRIeFB/HseE9VQ8sPh9z7OMSHdSvvsO0QY7tDpD6ftkZY5qToi3qRAObc5ahXwK/ 4qiPSoHAwWRI2Y+XPMvXKEbwp9qWKQypzsQrRsBY8GuuMTa0Be4urx2ZJazez6kzqqQ7 Hz8A== 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 :to:subject:cc; bh=pNH02elVJeD44FBl3478jw9pZ5t5dBHDEalS3/Ft208=; b=dtzkwTodR8UjizS5Tb4FniZXsj6xDq3dYMd2UL/HfiQLjjfr7YYwlR/+mLyQ39O9EN MOl5s0Qn92C8q3pvGdumP4/Qbr5GFwi2ZbcizgIEb0N1GDnVSqlmR5iiCW1B7/gQgiS8 FRuRHcX03ml5U9Su64ZnTQ85ipc+UWoZvPhGMX+pIb7A+cr8fzZSflyr7Gp7lfE4v9zf +qOMBfERNw2390+AmWtdYtH2U79KNoV4pnUp4nwcP46mTYGBIf8XqCI3Zw8FCx8zBaRs JEMIwnpgRBOmfWX0F7KnHKP1qJDxb37FNa7b+PFh9JN8urUMlGQy+QgNRVkqPPoO815H 13Tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp42si11612231ejc.604.2021.10.06.23.22.03; Wed, 06 Oct 2021 23:22:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232601AbhJGGUa (ORCPT + 99 others); Thu, 7 Oct 2021 02:20:30 -0400 Received: from mga02.intel.com ([134.134.136.20]:48521 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231797AbhJGGU3 (ORCPT ); Thu, 7 Oct 2021 02:20:29 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10129"; a="213305887" X-IronPort-AV: E=Sophos;i="5.85,352,1624345200"; d="scan'208";a="213305887" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2021 23:18:33 -0700 X-IronPort-AV: E=Sophos;i="5.85,352,1624345200"; d="scan'208";a="478431836" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.214.191]) ([10.254.214.191]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2021 23:18:31 -0700 Cc: baolu.lu@linux.intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, arei.gonglei@huawei.com Subject: Re: [PATCH v2 1/2] iommu/vt-d: convert the return type of first_pte_in_page to bool To: "Longpeng(Mike)" , dwmw2@infradead.org, will@kernel.org, joro@8bytes.org References: <20211005152308.1061-1-longpeng2@huawei.com> <20211005152308.1061-2-longpeng2@huawei.com> From: Lu Baolu Message-ID: <62016e41-5d9d-2d42-e16f-59809f9f1f75@linux.intel.com> Date: Thu, 7 Oct 2021 14:18:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211005152308.1061-2-longpeng2@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/10/5 23:23, Longpeng(Mike) wrote: > first_pte_in_page() returns boolean value, so let's convert its > return type to bool. > > Signed-off-by: Longpeng(Mike) > --- > include/linux/intel-iommu.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h > index 05a65eb..a590b00 100644 > --- a/include/linux/intel-iommu.h > +++ b/include/linux/intel-iommu.h > @@ -708,7 +708,7 @@ static inline bool dma_pte_superpage(struct dma_pte *pte) > return (pte->val & DMA_PTE_LARGE_PAGE); > } > > -static inline int first_pte_in_page(struct dma_pte *pte) > +static inline bool first_pte_in_page(struct dma_pte *pte) > { > return !((unsigned long)pte & ~VTD_PAGE_MASK); > } > Probably, return IS_ALIGNED((unsigned long)pte, VTD_PAGE_SIZE); looks neater? Best regards, baolu