diff options
author | Desmond Yan <desmond.yan@broadcom.com> | 2021-01-28 22:04:03 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-29 16:57:38 +0100 |
commit | d71277dc9bd6789964405e0a55d70c1fb2098f84 (patch) | |
tree | 27d8e06dfc9a1549e073ad96b50f7b121e90abe5 /drivers/misc | |
parent | e4612ecd6f36e60c7bf0ad8922f11f6c3d557aea (diff) |
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: kernel test robot <lkp@intel.com>
Signed-off-by: Desmond Yan <desmond.yan@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Link: https://lore.kernel.org/r/20210129060403.14801-1-scott.branden@broadcom.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/bcm-vk/bcm_vk_msg.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/misc/bcm-vk/bcm_vk_msg.c b/drivers/misc/bcm-vk/bcm_vk_msg.c index eec90494777d..a363e2e4f7bc 100644 --- a/drivers/misc/bcm-vk/bcm_vk_msg.c +++ b/drivers/misc/bcm-vk/bcm_vk_msg.c @@ -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) |