提交 d71277dc 编写于 作者: D Desmond Yan 提交者: Greg Kroah-Hartman

misc: bcm-vk: fix set_q_num API precedence issue

Change set_q_num API to use if-else to make it more explicit,
and avoid a precedence rule issue.
Reported-by: Nkernel test robot <lkp@intel.com>
Signed-off-by: NDesmond Yan <desmond.yan@broadcom.com>
Signed-off-by: NScott Branden <scott.branden@broadcom.com>
Link: https://lore.kernel.org/r/20210129060403.14801-1-scott.branden@broadcom.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e4612ecd
......@@ -52,8 +52,14 @@ static u32 get_q_num(const struct vk_msg_blk *msg)
static void set_q_num(struct vk_msg_blk *msg, u32 q_num)
{
msg->trans_id = (msg->trans_id & ~BCM_VK_MSG_Q_MASK) |
(q_num >= VK_MSGQ_PER_CHAN_MAX) ? VK_MSGQ_NUM_DEFAULT : q_num;
u32 trans_q;
if (q_num >= VK_MSGQ_PER_CHAN_MAX)
trans_q = VK_MSGQ_NUM_DEFAULT;
else
trans_q = q_num;
msg->trans_id = (msg->trans_id & ~BCM_VK_MSG_Q_MASK) | trans_q;
}
static u32 get_msg_id(const struct vk_msg_blk *msg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册