[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-5.2 v2 2/4] hw/net/can/ctucan: Avoid unused value in ctuc
From: |
Peter Maydell |
Subject: |
Re: [PATCH for-5.2 v2 2/4] hw/net/can/ctucan: Avoid unused value in ctucan_send_ready_buffers() |
Date: |
Tue, 10 Nov 2020 21:05:51 +0000 |
On Tue, 10 Nov 2020 at 19:37, Pavel Pisa <pisa@cmp.felk.cvut.cz> wrote:
>
> Hello Peter,
>
> On Tuesday 10 of November 2020 18:06:02 Peter Maydell wrote:
> > @@ -256,10 +254,7 @@ static void ctucan_send_ready_buffers(CtuCanCoreState
> > *s) for (i = 0; i < CTUCAN_CORE_TXBUF_NUM; i++) {
> > uint32_t prio;
> >
> > - buff_st_mask = 0xf << (i * 4);
> > - buff_st = (s->tx_status.u32 >> (i * 4)) & 0xf;
> > -
> > - if (buff_st != TXT_RDY) {
> > + if (extract32(s->tx_status.u32, i * 4, 4) != TXT_RDY) {
> > continue;
> > }
> > prio = (s->tx_priority.u32 >> (i * 4)) & 0x7;
> > @@ -271,10 +266,7 @@ static void ctucan_send_ready_buffers(CtuCanCoreState
> > *s) if (buff2tx_idx == -1) {
> > break;
> > }
> > - buff_st_mask = 0xf << (buff2tx_idx * 4);
> > - buff_st = (s->tx_status.u32 >> (buff2tx_idx * 4)) & 0xf;
> > int_stat.u32 = 0;
> > - buff_st = TXT_RDY;
>
> I would prefer to add there next line even that it has no real effect
>
> + s->tx_status.u32 = deposit32(s->tx_status.u32,
> + buff2tx_idx * 4, 4, TXT_RDY);
I mentioned this in a reply to my v1 series. The buffer status
in the tx_status field is already TXT_RDY, so there is no state
change happening here to document as far as I can tell ?
thanks
-- PMM
[PATCH for-5.2 v2 3/4] hw/net/can/ctucan_core: Handle big-endian hosts, Peter Maydell, 2020/11/10
[PATCH for-5.2 v2 4/4] hw/net/can/ctucan_core: Use stl_le_p to write to tx_buffers, Peter Maydell, 2020/11/10