Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756728Ab3DYJTN (ORCPT ); Thu, 25 Apr 2013 05:19:13 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:61867 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754630Ab3DYJTM (ORCPT ); Thu, 25 Apr 2013 05:19:12 -0400 Date: Thu, 25 Apr 2013 10:19:06 +0100 From: Lee Jones To: Linus Walleij Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Rabin Vincent , Linus WALLEIJ , Arnd Bergmann , Vinod Koul , Per Forlin , Dan Williams Subject: Re: [PATCH 05/32] dmaengine: ste_dma40: Supply macros to resolve 'src' and 'dst' directions Message-ID: <20130425091906.GG4623@gmail.com> References: <1366279934-30761-1-git-send-email-lee.jones@linaro.org> <1366279934-30761-6-git-send-email-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1862 Lines: 51 On Thu, 25 Apr 2013, Linus Walleij wrote: > On Thu, Apr 18, 2013 at 12:11 PM, Lee Jones wrote: > > > There are lots of lengthy if() statements located sporadically up and > > down the driver. This simple macro should make many of them a little > > simpler to decipher. The remainder have to stay in place, as they > > detail slightly more specific settings. > > > > Cc: Vinod Koul > > Cc: Dan Williams > > Cc: Per Forlin > > Cc: Rabin Vincent > > Signed-off-by: Lee Jones > (...) > > > +#define D40_IS_SRC(dir) ((dir == STEDMA40_PERIPH_TO_MEM) ? true : false) > > And when I reas the code and see D40_IS_SRC, what does that > mean? That the channel is a source of .. what exactly? > > The older explicit comparison would be more informative. > > > +#define D40_IS_DST(dir) (((dir == STEDMA40_MEM_TO_PERIPH) || \ > > + (dir == STEDMA40_MEM_TO_MEM)) ? true : false) > > + > > The comparison to STEDMA40_MEM_TO_MEM is unintelligible, if I see > that macro it has a very unintuitive name, since it is not just > DST but also SRC. > > The latter macro would be named somthing like D40_IS_DST_OR_MEM2MEM > and then it will not simplify the code very much. > > You need to come up with something different here, this is just making the > driver harder to understand. > > I think this patch should be just dropped. Okay. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- 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/