Re: [PATCH 1/9] dmaengine: dw-edma: Fix the ch_count hdma callback

Köry Maincent
2023-06-19T18:08:00Z

On Mon, 19 Jun 2023 00:07:09 +0300
Serge Semin <fancer.lancer@gmail.com> wrote:

> > diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > b/drivers/dma/dw-edma/dw-hdma-v0-core.c index 00b735a0202a..de87ce6b8585
> > 100644 --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > @@ -65,18 +65,7 @@ static void dw_hdma_v0_core_off(struct dw_edma *dw)
> >
> > static u16 dw_hdma_v0_core_ch_count(struct dw_edma *dw, enum dw_edma_dir
> > dir) {
> > - u32 num_ch = 0;
> > - int id;
> > -
> > - for (id = 0; id < HDMA_V0_MAX_NR_CH; id++) {
> > - if (GET_CH_32(dw, id, dir, ch_en) & BIT(0))
> > - num_ch++;
> > - }
> > -
> > - if (num_ch > HDMA_V0_MAX_NR_CH)
> > - num_ch = HDMA_V0_MAX_NR_CH;
> > -
> > - return (u16)num_ch;
> > + return HDMA_V0_MAX_NR_CH;
>
> Mainly I am ok with this change. But it would be nice to have a
> comment inlined here of why the number of channels is fixed and that
> the platform is responsible for specifying the real number of channels
> (it's basically what you described in the patch log).

Ok I will, thanks for your review.

Köry