Re: [PATCH v2 1/2] hw/dma: sifive_pdma: Fix Control.claim bit detection

2021-09-28 Thread Alistair Francis
On Mon, Sep 27, 2021 at 5:21 PM Bin Meng wrote: > > At present the codes detect whether the DMA channel is claimed by: > > claimed = !!s->chan[ch].control & CONTROL_CLAIM; > > As ! has higher precedence over & (bitwise and), this is essentially > > claimed = (!!s->chan[ch].control) &

Re: [PATCH v2 1/2] hw/dma: sifive_pdma: Fix Control.claim bit detection

2021-09-27 Thread Bin Meng
Hi Philippe, On Mon, Sep 27, 2021 at 8:56 PM Philippe Mathieu-Daudé wrote: > > On 9/27/21 09:21, Bin Meng wrote: > > At present the codes detect whether the DMA channel is claimed by: > > > > claimed = !!s->chan[ch].control & CONTROL_CLAIM; > > > > As ! has higher precedence over & (bitwise

Re: [PATCH v2 1/2] hw/dma: sifive_pdma: Fix Control.claim bit detection

2021-09-27 Thread Philippe Mathieu-Daudé
On 9/27/21 09:21, Bin Meng wrote: > At present the codes detect whether the DMA channel is claimed by: > > claimed = !!s->chan[ch].control & CONTROL_CLAIM; > > As ! has higher precedence over & (bitwise and), this is essentially > > claimed = (!!s->chan[ch].control) & CONTROL_CLAIM; > >

[PATCH v2 1/2] hw/dma: sifive_pdma: Fix Control.claim bit detection

2021-09-27 Thread Bin Meng
At present the codes detect whether the DMA channel is claimed by: claimed = !!s->chan[ch].control & CONTROL_CLAIM; As ! has higher precedence over & (bitwise and), this is essentially claimed = (!!s->chan[ch].control) & CONTROL_CLAIM; which is wrong, as any non-zero bit set in the control