Thread (15 messages) flat view 15 messages, 6 authors, 2024-07-15

Re: [PATCH v4 1/3] mctp pcc: Check before sending MCTP PCC response ACK

From: Jeremy Kerr <jk@codeconstruct.com.au>
Date: 2024-07-04 09:41:09
Also in: lkml

Hi Adam,
+static void check_and_ack(struct pcc_chan_info *pchan, struct mbox_chan *chan)
+{
+       struct pcc_extended_type_hdr pcc_hdr;
+
+       if (pchan->type != ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE)
+               return;
+       memcpy_fromio(&pcc_hdr, pchan->shmem_base_addr,
+                     sizeof(struct pcc_extended_type_hdr));
+       /*
+        * The PCC slave subspace channel needs to set the command complete bit
+        * and ring doorbell after processing message.
+        *
+        * The PCC master subspace channel clears chan_in_use to free channel.
+        */
+       if (!!le32_to_cpup(&pcc_hdr.flags) & PCC_ACK_FLAG_MASK)
This should be:

       if (!!(le32_to_cpup(&pcc_hdr.flags) & PCC_ACK_FLAG_MASK))

- otherwise you're bitwise testing the result of the '!!'.

Cheers,


Jeremy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help