Thread (1 message) flat view 1 message, 1 author, 2022-09-07

Re: [PATCH v6 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group

From: Joerg Roedel <joro@8bytes.org>
Date: 2022-09-07 14:06:43
Also in: asahi, kvm, linux-arm-kernel, linux-arm-msm, linux-iommu, linux-s390, linux-tegra, lkml

On Wed, Sep 07, 2022 at 10:47:39AM -0300, Jason Gunthorpe wrote:
Would you be happier if we wrote it like

 #define IOMMU_EINCOMPATIBLE_DEVICE xx

Which tells "which of the function parameters is actually invalid" ?
Having done some Rust hacking in the last months, I have to say I like
to concept of error handling with Result<> there. Ideally we have a way
to emulate that in our C code without having to change all callers.

What I am proposing is a way this could be emulated here, but I am open
to other suggestions. Still better than re-using random error codes for
special purposes.

Regards,

	Joerg
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help