提交 b45f3ccf 编写于 作者: T Tomas Winkler 提交者: Greg Kroah-Hartman

mei: streamline the _mei_irq_thread_close/ioctol functions

change statements of types

	if (ok)
		do something
	else
		return err

into

	if (err)
		return err

	do something
Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7bdf72d3
...@@ -299,8 +299,10 @@ static int _mei_irq_thread_close(struct mei_device *dev, s32 *slots, ...@@ -299,8 +299,10 @@ static int _mei_irq_thread_close(struct mei_device *dev, s32 *slots,
struct mei_cl *cl, struct mei_cl *cl,
struct mei_io_list *cmpl_list) struct mei_io_list *cmpl_list)
{ {
if ((*slots * sizeof(u32)) >= (sizeof(struct mei_msg_hdr) + if ((*slots * sizeof(u32)) < (sizeof(struct mei_msg_hdr) +
sizeof(struct hbm_client_disconnect_request))) { sizeof(struct hbm_client_disconnect_request)))
return -EBADMSG;
*slots -= mei_data2slots(sizeof(struct hbm_client_disconnect_request)); *slots -= mei_data2slots(sizeof(struct hbm_client_disconnect_request));
if (mei_disconnect(dev, cl)) { if (mei_disconnect(dev, cl)) {
...@@ -317,10 +319,6 @@ static int _mei_irq_thread_close(struct mei_device *dev, s32 *slots, ...@@ -317,10 +319,6 @@ static int _mei_irq_thread_close(struct mei_device *dev, s32 *slots,
&dev->ctrl_rd_list.mei_cb.cb_list); &dev->ctrl_rd_list.mei_cb.cb_list);
cl->timer_count = MEI_CONNECT_TIMEOUT; cl->timer_count = MEI_CONNECT_TIMEOUT;
} }
} else {
/* return the cancel routine */
return -EBADMSG;
}
return 0; return 0;
} }
...@@ -869,8 +867,13 @@ static int _mei_irq_thread_ioctl(struct mei_device *dev, s32 *slots, ...@@ -869,8 +867,13 @@ static int _mei_irq_thread_ioctl(struct mei_device *dev, s32 *slots,
struct mei_cl *cl, struct mei_cl *cl,
struct mei_io_list *cmpl_list) struct mei_io_list *cmpl_list)
{ {
if ((*slots * sizeof(u32)) >= (sizeof(struct mei_msg_hdr) + if ((*slots * sizeof(u32)) < (sizeof(struct mei_msg_hdr) +
sizeof(struct hbm_client_connect_request))) { sizeof(struct hbm_client_connect_request))) {
/* return the cancel routine */
list_del(&cb_pos->cb_list);
return -EBADMSG;
}
cl->state = MEI_FILE_CONNECTING; cl->state = MEI_FILE_CONNECTING;
*slots -= mei_data2slots(sizeof(struct hbm_client_connect_request)); *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request));
if (mei_connect(dev, cl)) { if (mei_connect(dev, cl)) {
...@@ -883,12 +886,6 @@ static int _mei_irq_thread_ioctl(struct mei_device *dev, s32 *slots, ...@@ -883,12 +886,6 @@ static int _mei_irq_thread_ioctl(struct mei_device *dev, s32 *slots,
&dev->ctrl_rd_list.mei_cb.cb_list); &dev->ctrl_rd_list.mei_cb.cb_list);
cl->timer_count = MEI_CONNECT_TIMEOUT; cl->timer_count = MEI_CONNECT_TIMEOUT;
} }
} else {
/* return the cancel routine */
list_del(&cb_pos->cb_list);
return -EBADMSG;
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册