Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754345AbbK3Off (ORCPT ); Mon, 30 Nov 2015 09:35:35 -0500 Received: from mail-yk0-f169.google.com ([209.85.160.169]:33514 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754044AbbK3Ofc (ORCPT ); Mon, 30 Nov 2015 09:35:32 -0500 MIME-Version: 1.0 In-Reply-To: <1448891145-10766-2-git-send-email-peter.ujfalusi@ti.com> References: <1448891145-10766-1-git-send-email-peter.ujfalusi@ti.com> <1448891145-10766-2-git-send-email-peter.ujfalusi@ti.com> Date: Mon, 30 Nov 2015 16:35:31 +0200 Message-ID: Subject: Re: [RFC v02 01/15] dmaengine: core: Allow NULL mask pointer in __dma_device_satisfies_mask() From: Andy Shevchenko To: Peter Ujfalusi Cc: Vinod Koul , Arnd Bergmann , "linux-kernel@vger.kernel.org" , dmaengine , Linux OMAP Mailing List , linux-arm Mailing List , "linux-mmc@vger.kernel.org" , Sekhar Nori , linux-spi Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1282 Lines: 43 On Mon, Nov 30, 2015 at 3:45 PM, Peter Ujfalusi wrote: > Treat as true condition the case when the mask is NULL. What do you think about setting some default (all "on") mask when mask is not supplied? I don't know for sure but there might be cases when you don't want literally *any* channel to satisfy. > > Signed-off-by: Peter Ujfalusi > --- > drivers/dma/dmaengine.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c > index daf54a39bcc7..52c3eee48e2e 100644 > --- a/drivers/dma/dmaengine.c > +++ b/drivers/dma/dmaengine.c > @@ -184,6 +184,9 @@ __dma_device_satisfies_mask(struct dma_device *device, > { > dma_cap_mask_t has; > > + if (!want) > + return true; > + > bitmap_and(has.bits, want->bits, device->cap_mask.bits, > DMA_TX_TYPE_END); > return bitmap_equal(want->bits, has.bits, DMA_TX_TYPE_END); > -- > 2.6.3 > -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/