Loading drivers/mailbox/qcom-rpmh-mailbox.c +5 −4 Original line number Original line Diff line number Diff line Loading @@ -695,10 +695,11 @@ static int find_match(struct tcs_mbox *tcs, struct tcs_cmd *cmd, int len) } } /* sanity check to ensure the seq is same */ /* sanity check to ensure the seq is same */ for (j = 1; j < len; j++) { for (j = 1; j < len; j++) { WARN((tcs->cmd_addr[i + j] != cmd[j].addr), if (tcs->cmd_addr[i + j] != cmd[j].addr) { "Message does not match previous sequence.\n"); pr_debug("Message does not match previous sequence.\n"); return -EINVAL; return -EINVAL; } } } found = true; found = true; break; break; } } Loading @@ -725,12 +726,12 @@ static int find_slots(struct tcs_mbox *tcs, struct tcs_mbox_msg *msg) do { do { slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS, slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS, n, msg->num_payload, 0); n, msg->num_payload, 0); if (slot == MAX_TCS_SLOTS) if (slot >= MAX_TCS_SLOTS) break; break; n += tcs->ncpt; n += tcs->ncpt; } while (slot + msg->num_payload - 1 >= n); } while (slot + msg->num_payload - 1 >= n); return (slot != MAX_TCS_SLOTS) ? slot : -ENOMEM; return (slot < MAX_TCS_SLOTS) ? slot : -ENOMEM; } } static int tcs_mbox_write(struct mbox_chan *chan, struct tcs_mbox_msg *msg, static int tcs_mbox_write(struct mbox_chan *chan, struct tcs_mbox_msg *msg, Loading Loading
drivers/mailbox/qcom-rpmh-mailbox.c +5 −4 Original line number Original line Diff line number Diff line Loading @@ -695,10 +695,11 @@ static int find_match(struct tcs_mbox *tcs, struct tcs_cmd *cmd, int len) } } /* sanity check to ensure the seq is same */ /* sanity check to ensure the seq is same */ for (j = 1; j < len; j++) { for (j = 1; j < len; j++) { WARN((tcs->cmd_addr[i + j] != cmd[j].addr), if (tcs->cmd_addr[i + j] != cmd[j].addr) { "Message does not match previous sequence.\n"); pr_debug("Message does not match previous sequence.\n"); return -EINVAL; return -EINVAL; } } } found = true; found = true; break; break; } } Loading @@ -725,12 +726,12 @@ static int find_slots(struct tcs_mbox *tcs, struct tcs_mbox_msg *msg) do { do { slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS, slot = bitmap_find_next_zero_area(tcs->slots, MAX_TCS_SLOTS, n, msg->num_payload, 0); n, msg->num_payload, 0); if (slot == MAX_TCS_SLOTS) if (slot >= MAX_TCS_SLOTS) break; break; n += tcs->ncpt; n += tcs->ncpt; } while (slot + msg->num_payload - 1 >= n); } while (slot + msg->num_payload - 1 >= n); return (slot != MAX_TCS_SLOTS) ? slot : -ENOMEM; return (slot < MAX_TCS_SLOTS) ? slot : -ENOMEM; } } static int tcs_mbox_write(struct mbox_chan *chan, struct tcs_mbox_msg *msg, static int tcs_mbox_write(struct mbox_chan *chan, struct tcs_mbox_msg *msg, Loading