[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200817183311.GD3464@kozik-lap>
Date: Mon, 17 Aug 2020 20:33:11 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Arnd Bergmann <arnd@...db.de>, Olof Johansson <olof@...om.net>,
Markus Mayer <mmayer@...adcom.com>,
bcm-kernel-feedback-list@...adcom.com,
Florian Fainelli <f.fainelli@...il.com>,
Santosh Shilimkar <ssantosh@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Roger Quadros <rogerq@...com>,
Tony Lindgren <tony@...mide.com>,
Vladimir Zapolskiy <vz@...ia.com>,
Kukjin Kim <kgene@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-omap@...r.kernel.org,
linux-samsung-soc@...r.kernel.org, linux-tegra@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFT v2 21/29] memory: omap-gpmc: Remove GPMC_SET_ONE_CD_MAX
macro for safety
On Fri, Jul 24, 2020 at 09:40:30AM +0200, Krzysztof Kozlowski wrote:
> The GPMC_SET_ONE_CD_MAX macro uses return statement and variable 'cs'
> coming from called scope. This is not a good practice. Also
> checkpatch complained:
>
> WARNING: Macros with flow control statements should be avoided
> ERROR: Macros starting with if should be enclosed by a do - while
> loop to avoid possible if/else logic defects
>
> Since GPMC_SET_ONE_CD_MAX macro just calls one function, it can be open
> coded. The difference with original code is that function will exit on
> error not after every register set, but after a group of sets.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
>
> ---
>
Applied.
Best regards,
Krzysztof
Powered by blists - more mailing lists