[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] intel_iommu: a fix to vtd_dev_get_trans_type()
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH] intel_iommu: a fix to vtd_dev_get_trans_type() |
Date: |
Mon, 25 Dec 2017 13:45:22 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Thu, Dec 21, 2017 at 02:15:19PM +0800, Liu, Yi L wrote:
> vtd_ce_get_type() returns uin32_t and vtd_dev_get_trans_type() returns
> the value from vtd_ce_get_type(). However, vtd_dev_get_trans_type()
> returns int. This patch switchs to return the translation type by
> parameter. It avoids unsigned to int transfer and also avoid potential
> reading confusion.
Frankly speaking I would still prefer the old way to do it: return
type when >=0 and error when <0. After all we have a comment for
vtd_dev_get_trans_type() already:
/*
* Fetch translation type for specific device. Returns <0 if error
* happens, otherwise return the shifted type to check against
* VTD_CONTEXT_TT_*.
*/
Thanks,
--
Peter Xu