[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250904112926.351309-1-liaoyuanhong@vivo.com>
Date: Thu, 4 Sep 2025 19:29:26 +0800
From: Liao Yuanhong <liaoyuanhong@...o.com>
To: Jassi Brar <jassisinghbrar@...il.com>,
linux-kernel@...r.kernel.org (open list:MAILBOX API)
Cc: Liao Yuanhong <liaoyuanhong@...o.com>
Subject: [PATCH] mailbox: bcm-flexrm-mailbox: Remove redundant ternary operators
For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.
Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
---
drivers/mailbox/bcm-flexrm-mailbox.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
index 41f79e51d9e5..99b4cdfb82bd 100644
--- a/drivers/mailbox/bcm-flexrm-mailbox.c
+++ b/drivers/mailbox/bcm-flexrm-mailbox.c
@@ -329,7 +329,7 @@ static bool flexrm_is_next_table_desc(void *desc_ptr)
u64 desc = flexrm_read_desc(desc_ptr);
u32 type = DESC_DEC(desc, DESC_TYPE_SHIFT, DESC_TYPE_MASK);
- return (type == NPTR_TYPE) ? true : false;
+ return type == NPTR_TYPE;
}
static u64 flexrm_next_table_desc(u32 toggle, dma_addr_t next_addr)
@@ -1217,7 +1217,7 @@ static bool flexrm_peek_data(struct mbox_chan *chan)
{
int cnt = flexrm_process_completions(chan->con_priv);
- return (cnt > 0) ? true : false;
+ return cnt > 0;
}
static int flexrm_startup(struct mbox_chan *chan)
--
2.34.1
Powered by blists - more mailing lists