Re: [PATCH v3 4/5] iommu/ioasid: Rename INVALID_IOASID

From: Jacob Pan
Date: Fri Feb 17 2023 - 11:30:00 EST


Hi Fenghua,

On Thu, 16 Feb 2023 17:23:15 -0800, Fenghua Yu <fenghua.yu@xxxxxxxxx> wrote:

> > --- a/drivers/dma/idxd/irq.c
> > +++ b/drivers/dma/idxd/irq.c
> > @@ -80,7 +80,7 @@ static void idxd_int_handle_revoke_drain(struct
> > idxd_irq_entry *ie) desc.opcode = DSA_OPCODE_DRAIN;
> > desc.priv = 1;
> >
> > - if (ie->pasid != INVALID_IOASID)
> > + if (ie->pasid != IOMMU_PASID_INVALID)
>
> It's better to change to:
> + if (pasid_valid(ie->paid))
>
> If pasid_vaild() is called, any invalid PASID value change in the future
> will be hidden in pasid_valid() and won't impact this code any more.
>
> And checking pasid_valid() is more readable and meaninful than direct
> checking the invalid PASID value.
Sounds good, here I'm just renaming. I will submit another patch to
convert.

Thanks,

Jacob