From: "Csókás Bence" <csokas.bence@prolan.hu>
To: Amit Singh Tomar <amitsinght@marvell.com>,
<dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-sunxi@lists.linux.dev>
Cc: Mesih Kilinc <mesihkilinc@gmail.com>,
Vinod Koul <vkoul@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>
Subject: Re: [PATCH v4 04/10] dma-engine: sun4i: Add support for Allwinner suniv F1C100s
Date: Sat, 2 Nov 2024 10:06:49 +0100 [thread overview]
Message-ID: <4a52cf8b-dd55-4bf8-8c37-29c07749bee0@prolan.hu> (raw)
In-Reply-To: <53df7ebb-d6bf-4b34-98b6-442fdbd5d348@marvell.com>
On 2024. 10. 31. 20:05, Amit Singh Tomar wrote:
>> #define SUN4I_DMA_CFG_SRC_ADDR_MODE(mode) ((mode) << 5)
>> #define SUN4I_DMA_CFG_SRC_DRQ_TYPE(type) (type)
>> +#define SUNIV_DMA_CFG_DST_DATA_WIDTH(width) ((width) << 24)
>> +#define SUNIV_DMA_CFG_SRC_DATA_WIDTH(width) ((width) << 8)
>
> nit: Are the extra parentheses around width truly necessary? They seem
> to be used throughout the file.
It's macro safety. So for instance if someone writes
~SUNIV_DMA_CFG_DST_DATA_WIDTH(1 + 2), which would expand to ~1 + 2 << 24
it doesn't get mis-interpreted as (~1) + (2 << 24) for instance. So
yeah, I sure hope that _all code_ that has macros with parameters did
not forget to wrap everything in parentheses, and not just "throughout
[this] file".
Bence
next prev parent reply other threads:[~2024-11-02 9:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 12:35 [PATCH v4 01/10] dma-engine: sun4i: Add a quirk to support different chips Csókás, Bence
2024-10-31 12:35 ` [PATCH v4 02/10] dma-engine: sun4i: Add has_reset option to quirk Csókás, Bence
2024-10-31 15:47 ` Krzysztof Kozlowski
2024-10-31 12:35 ` [PATCH v4 03/10] dt-bindings: dmaengine: Add Allwinner suniv F1C100s DMA Csókás, Bence
2024-10-31 18:17 ` Rob Herring
2024-11-02 8:57 ` Csókás Bence
2024-10-31 12:35 ` [PATCH v4 04/10] dma-engine: sun4i: Add support for Allwinner suniv F1C100s Csókás, Bence
2024-10-31 19:05 ` Amit Singh Tomar
2024-11-02 9:06 ` Csókás Bence [this message]
2024-10-31 18:15 ` [PATCH v4 01/10] dma-engine: sun4i: Add a quirk to support different chips Amit Singh Tomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a52cf8b-dd55-4bf8-8c37-29c07749bee0@prolan.hu \
--to=csokas.bence@prolan.hu \
--cc=amitsinght@marvell.com \
--cc=dmaengine@vger.kernel.org \
--cc=jernej.skrabec@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=mesihkilinc@gmail.com \
--cc=samuel@sholland.org \
--cc=vkoul@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox