Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mei: simplify write complete loop in irq handler

extract the common, hence non conditional code
from the if-else statment

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tomas Winkler and committed by
Greg Kroah-Hartman
be9d87a7 9a84d616

+12 -25
+12 -25
drivers/misc/mei/interrupt.c
··· 1027 1027 cl = pos->cl; 1028 1028 if (cl == NULL) 1029 1029 continue; 1030 + if (mei_flow_ctrl_creds(dev, cl) <= 0) { 1031 + dev_dbg(&dev->pdev->dev, 1032 + "No flow control credentials for client %d, not sending.\n", 1033 + cl->host_client_id); 1034 + continue; 1035 + } 1030 1036 1031 - if (cl != &dev->iamthif_cl) { 1032 - if (mei_flow_ctrl_creds(dev, cl) <= 0) { 1033 - dev_dbg(&dev->pdev->dev, 1034 - "No flow control credentials for client %d, not sending.\n", 1035 - cl->host_client_id); 1036 - continue; 1037 - } 1038 - ret = mei_irq_thread_write_complete(dev, &slots, pos, 1039 - cmpl_list); 1040 - if (ret) 1041 - return ret; 1042 - 1043 - } else if (cl == &dev->iamthif_cl) { 1044 - /* IAMTHIF IOCTL */ 1045 - dev_dbg(&dev->pdev->dev, "complete amthi write cb.\n"); 1046 - if (mei_flow_ctrl_creds(dev, cl) <= 0) { 1047 - dev_dbg(&dev->pdev->dev, 1048 - "No flow control credentials for amthi client %d.\n", 1049 - cl->host_client_id); 1050 - continue; 1051 - } 1037 + if (cl == &dev->iamthif_cl) 1052 1038 ret = mei_amthif_irq_write_complete(dev, &slots, 1053 1039 pos, cmpl_list); 1054 - if (ret) 1055 - return ret; 1056 - 1057 - } 1040 + else 1041 + ret = mei_irq_thread_write_complete(dev, &slots, pos, 1042 + cmpl_list); 1043 + if (ret) 1044 + return ret; 1058 1045 1059 1046 } 1060 1047 return 0;