Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3038345pxb; Tue, 12 Jan 2021 05:00:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhkgoPbVQpiiZoPDxyfWq0yvZY2rodG2mLgj2oJZuph94u/0cjo0xWaz0rFpu4qHwZbvW1 X-Received: by 2002:a05:6402:17cb:: with SMTP id s11mr3190024edy.119.1610456455239; Tue, 12 Jan 2021 05:00:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610456455; cv=none; d=google.com; s=arc-20160816; b=Cd3kH8Z95vU5c5INL5scZ1SufouP6wEOT8oc5uujwpE61mWzk4oya8PXuRswaHYp8k 37qYFG3Fhw8xR72hOof4wPmcaRQGg1IuxJGRJoRM8GBFD8q5uljz/6/Bny14eVVNvLeJ muaFi0vQ6DksCWLsz9VvoUl5gxJt+WP6gOHUkD6cHiurENbHmBcX8LFwpnnINUWCJae+ ApEKrjTEAbtmPBdBCLUSDcS9Bx6Xc+xK/WEdpHHUiSuvRYf+AkoXiBGGh2UJZQBToEsZ I47niYt8n6ixaHJvAH08LUtEHa3cAVsSJ8+OqQOZ34yM4/XD0WvGTtvMYfflF83C+WgP uUtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=xxaoSb3PjXzlAj8ecx6MMWJ7sUQbD4SSImbDVCX9Ilw=; b=MmQAvdhiq4I+xTIl5dcqVSUCmsryfcPGwJUoF403XnFgEsx8LLfUMG1jsprlU+1NIK VBRC7QMW0u/K/x1itlXeA3dJeVyi2N53ywuji+eDjMu48dLcRVRjHqodk7oC0ygQO4zt LWC1rX4r0vJZMGRu+VYLrMAj51NeOJHRrIxWZsKCk65gdi6/S2tY0quJqwUjziCM93A8 cEXP2aaYj0xFbypdhNMg2v0vE0Lqccbiazia2inKh9GbqQU/vcsNPVRneDA7RHxrSSxZ B6havrcLS5phFzmFzOAabucXt12LGJgqlNtDukrC6AHdQFnyuhbPcXk+4U7qj8q7qs/e yRiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si1068449eja.441.2021.01.12.05.00.30; Tue, 12 Jan 2021 05:00:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728175AbhALKtU (ORCPT + 99 others); Tue, 12 Jan 2021 05:49:20 -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-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: linux-kernel@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