On Wed, Feb 14, 2024 at 05:55:23PM +0000, Robin Murphy wrote:
#define DMA_F_PCI_P2PDMA_SUPPORTED (1 << 0)
+#define DMA_F_CAN_SKIP_SYNC BIT(1)
Yuck, please be consistent - either match the style of the existing code,
or change that to BIT(0) as well.
Just don't use BIT() ever. It doesn't save any typing and creates a
totally pointless mental indirection.
I guess this was the existing condition from dma_need_sync(), but now it's
on a one-off slow path it might be nice to check the sync_sg_* ops as well
for completeness, or at least comment that nobody should be implementing
those without also implementing the sync_single_* ops.
Implementing only one and not the other doesn't make any sense. Maybe
a debug check for that is ok, but thing will break badly if they aren't
in sync anyway.