Skip to content

Commit 29237e6

Browse files
sudeep-hollaJassi Brar
authored andcommitted
mailbox: pcc: Drop unnecessary endianness conversion of pcc_hdr.flags
The Sparse static checker flags a type mismatch warning related to endianness conversion: | warning: incorrect type in argument 1 (different base types) | expected restricted __le32 const [usertype] *p | got unsigned int * This is because an explicit endianness conversion (le32_to_cpu()) was applied unnecessarily to a pcc_hdr.flags field that is already in little-endian format. The PCC driver is only enabled on little-endian kernels due to its dependency on ACPI and EFI, making the explicit conversion unnecessary. The redundant conversion occurs in pcc_chan_check_and_ack() for the pcc_hdr.flags field. Drop this unnecessary endianness conversion of pcc_hdr.flags. Also drop the redundant PCC_ACK_FLAG_MASK definition and use the more appropriate and already defined PCC_CMD_COMPLETION_NOTIFY. Acked-by: Huisong Li <lihuisong@huawei.com> Tested-by: Adam Young <admiyo@os.amperecomputing.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
1 parent cf1338c commit 29237e6

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

drivers/mailbox/pcc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static void check_and_ack(struct pcc_chan_info *pchan, struct mbox_chan *chan)
292292
*
293293
* The PCC master subspace channel clears chan_in_use to free channel.
294294
*/
295-
if (le32_to_cpup(&pcc_hdr.flags) & PCC_ACK_FLAG_MASK)
295+
if (pcc_hdr.flags & PCC_CMD_COMPLETION_NOTIFY)
296296
pcc_send_data(chan, NULL);
297297
else
298298
pcc_chan_reg_read_modify_write(&pchan->cmd_update);

include/acpi/pcc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ struct pcc_mbox_chan {
3232
#define PCC_CMD_COMPLETION_NOTIFY BIT(0)
3333

3434
#define MAX_PCC_SUBSPACES 256
35-
#define PCC_ACK_FLAG_MASK 0x1
3635

3736
#ifdef CONFIG_PCC
3837
extern struct pcc_mbox_chan *

0 commit comments

Comments
 (0)