Re: [PATCH v3 01/28] dmaengine: bcm2835: Fix coding style issues and a typo

From: Andrea della Porta

Date: Thu Nov 26 2026 - 09:22:08 EST


Hi Frank,

On 14:12 Tue 24 Nov , Frank Li wrote:
> On Mon, Nov 23, 2026 at 03:56:39PM +0100, Andrea della Porta wrote:
> > Fix the coding style issues reported by checkpatch: use u32 instead of
> > uint32_t, add the missing parentheses around macro arguments, which
> > could lead to operator precedence issues, drop superfluous parentheses
> > and long int, and align the function arguments. Also fix a typo in a
> > comment ('missmatch').
> >
> > Signed-off-by: Andrea della Porta <andrea.porta@xxxxxxxx>
> > ---
> > drivers/dma/bcm2835-dma.c | 83 ++++++++++++++++++++-------------------
> > 1 file changed, 42 insertions(+), 41 deletions(-)
> >
> > diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
> > index 06d830d36882..b19182c6e3df 100644
> > --- a/drivers/dma/bcm2835-dma.c
> > +++ b/drivers/dma/bcm2835-dma.c
> > @@ -51,13 +51,13 @@ struct bcm2835_dmadev {
> > };
> >
> > struct bcm2835_dma_cb {
> > - uint32_t info;
> > - uint32_t src;
> > - uint32_t dst;
> > - uint32_t length;
> > - uint32_t stride;
> > - uint32_t next;
> > - uint32_t pad[2];
> > + u32 info;
> > + u32 src;
> > + u32 dst;
> > + u32 length;
> > + u32 stride;
> > + u32 next;
> > + u32 pad[2];
> > };
> >
> > struct bcm2835_cb_entry {
> > @@ -116,8 +116,8 @@ struct bcm2835_desc {
> > * AXI-write to ack
> > */
> > #define BCM2835_DMA_ERR BIT(8)
> > -#define BCM2835_DMA_PRIORITY(x) ((x & 15) << 16) /* AXI priority */
> > -#define BCM2835_DMA_PANIC_PRIORITY(x) ((x & 15) << 20) /* panic priority */
> > +#define BCM2835_DMA_PRIORITY(x) (((x) & 15) << 16) /* AXI priority */
> > +#define BCM2835_DMA_PANIC_PRIORITY(x) (((x) & 15) << 20) /* panic priority */
> > /* current value of TI.BCM2835_DMA_WAIT_RESP */
> > #define BCM2835_DMA_WAIT_FOR_WRITES BIT(28)
> > #define BCM2835_DMA_DIS_DEBUG BIT(29) /* disable debug pause signal */
> > @@ -136,9 +136,9 @@ struct bcm2835_desc {
> > #define BCM2835_DMA_S_WIDTH BIT(9) /* 128bit writes if set */
> > #define BCM2835_DMA_S_DREQ BIT(10) /* enable SREQ for source */
> > #define BCM2835_DMA_S_IGNORE BIT(11) /* ignore source reads - read 0 */
> > -#define BCM2835_DMA_BURST_LENGTH(x) ((x & 15) << 12)
> > -#define BCM2835_DMA_PER_MAP(x) ((x & 31) << 16) /* REQ source */
> > -#define BCM2835_DMA_WAIT(x) ((x & 31) << 21) /* add DMA-wait cycles */
> > +#define BCM2835_DMA_BURST_LENGTH(x) (((x) & 15) << 12)
> > +#define BCM2835_DMA_PER_MAP(x) (((x) & 31) << 16) /* REQ source */
> > +#define BCM2835_DMA_WAIT(x) (((x) & 31) << 21) /* add DMA-wait cycles */
>
> You touch these code, can you shift to use FIELD_PREP() macro ?

Done in v4: the register field macros now use FIELD_PREP.

Many thanks,
Andrea

>
> Frank