From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06F48C433E0 for ; Tue, 12 Jan 2021 10:49:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AADBF23109 for ; Tue, 12 Jan 2021 10:49:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727498AbhALKtT (ORCPT ); Tue, 12 Jan 2021 05:49:19 -0500 Received: from mail-ot1-f54.google.com ([209.85.210.54]:34536 "EHLO mail-ot1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727357AbhALKtT (ORCPT ); Tue, 12 Jan 2021 05:49:19 -0500 Received: by mail-ot1-f54.google.com with SMTP id a109so1858695otc.1; Tue, 12 Jan 2021 02:49:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xxaoSb3PjXzlAj8ecx6MMWJ7sUQbD4SSImbDVCX9Ilw=; b=gdNnI5qKtNO2j4hJo/hYPyIndguJRppoC2fjaPw63qanKFKX00tdQAOByLziSe6byR Z+AX0fqWR9FHQS2KsYVISMbjIhDEQ0TJSQhFJ74MJffaX9OT2fm34ygzQvpDa3bhDBN7 a7Zrx9f53XGF+16AH4O7KdmPA42t7uQ9XDcfDFb3GW+OIMTM9XcaSLAGWsq9YZ2v4SrM aZpHrhDFfkqPnEex8zOsfdMhtiPrzUbhpMY8/oDEZ4vW5uEL4ayVkCc+NquNEe4fvCgL 1Sp96FHry8QWFzkTYGn0gtjpQ7JF6q9ga5NvMMKQ3kFFbe5yRbJcoMQInfuHa2tmfE5W JjpA== X-Gm-Message-State: AOAM53008xCFTijWA7bP9AUlzre7SNXoJoygSgjTWoDgZwqyasO5VzDI jQD/bayVFH5PWUWB6MoI3sGTjBqFqwPpSW5LEQcXfHjQ X-Google-Smtp-Source: ABdhPJwKCUIIt+SLP419JvmRvcECIu9CcevrYHPbBN7ZEbhylHr0hsS0Xd8TKfUFzeBWLP9AOiY7iAT9SPUTCklO4cU= X-Received: by 2002:a05:6830:210a:: with SMTP id i10mr2337938otc.145.1610448518033; Tue, 12 Jan 2021 02:48:38 -0800 (PST) MIME-Version: 1.0 References: <20210107181524.1947173-1-geert+renesas@glider.be> <20210107181524.1947173-3-geert+renesas@glider.be> <20210112101950.GK2771@vkoul-mobl> <20210112103831.GM2771@vkoul-mobl> In-Reply-To: <20210112103831.GM2771@vkoul-mobl> From: Geert Uytterhoeven Date: Tue, 12 Jan 2021 11:48:27 +0100 Message-ID: Subject: Re: [PATCH 2/4] dmaengine: rcar-dmac: Add for_each_rcar_dmac_chan() helper To: Vinod Koul Cc: Rob Herring , Dan Williams , Yoshihiro Shimoda , Phong Hoang , dmaengine , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Hi Vinod, On Tue, Jan 12, 2021 at 11:38 AM Vinod Koul wrote: > On 12-01-21, 11:26, Geert Uytterhoeven wrote: > > On Tue, Jan 12, 2021 at 11:19 AM Vinod Koul wrote: > > > On 07-01-21, 19:15, Geert Uytterhoeven wrote: > > > > Add and helper macro for iterating over all DMAC channels, taking into > > > > account the channel mask. Use it where appropriate, to simplify code. > > > > > > > > Restore "reverse Christmas tree" order of local variables while adding a > > > > new variable. > > > > > > > > Signed-off-by: Geert Uytterhoeven > > > > > > --- a/drivers/dma/sh/rcar-dmac.c > > > > +++ b/drivers/dma/sh/rcar-dmac.c > > > > @@ -209,6 +209,11 @@ struct rcar_dmac { > > > > > > > > #define to_rcar_dmac(d) container_of(d, struct rcar_dmac, engine) > > > > > > > > +#define for_each_rcar_dmac_chan(i, chan, dmac) \ > > > > + for (i = 0, chan = &(dmac)->channels[0]; i < (dmac)->n_channels; \ > > > > + i++, chan++) \ > > > > > > single line to make it more readable? we have limit of 100 now :) > > > > Do we have to push the limits? > > In cases where it helps, I certainly recommend.. I feel in this case it > makes a better read to have it in a single line.. OK, will fix. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds