Re: [PATCH 4/5] dma-direct: implement complete bus_dma_mask handling

From: Robin Murphy
Date: Thu Sep 27 2018 - 12:41:42 EST


On 27/09/18 17:27, Christoph Hellwig wrote:
On Thu, Sep 27, 2018 at 05:14:56PM +0100, Robin Murphy wrote:
This just seemed more readable to me than min_not_zero, but if others
prefer min_not_zero I can switch.

Nah, just checking whether there were any intentionally different
assumptions compared to the couple of other places in the patch where
min_not_zero() *is* used. If it's purely a style thing then no worries
(personally I'd have written it yet another way anyway).

I'm curious: how would you have written it?

Come to think of it, I actually already have, in iommu-dma:

if (dev->bus_dma_mask)
mask &= dev->bus_dma_mask;

but of course it's not so pretty for those cases where you don't already have the local variable ready to go.

Robin.