Re: [PATCH v4 04/10] dma-engine: sun4i: Add support for Allwinner suniv F1C100s

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux