Commit cf9673da authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

staging: mei: rename num_mei_me_clients to me_clients_num

Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarOren Weil <oren.jer.weil@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a93218e1
...@@ -317,7 +317,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) ...@@ -317,7 +317,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
dev->extra_write_index = 0; dev->extra_write_index = 0;
} }
dev->num_mei_me_clients = 0; dev->me_clients_num = 0;
dev->rd_msg_hdr = 0; dev->rd_msg_hdr = 0;
dev->stop = false; dev->stop = false;
dev->wd_pending = false; dev->wd_pending = false;
...@@ -443,9 +443,9 @@ void mei_allocate_me_clients_storage(struct mei_device *dev) ...@@ -443,9 +443,9 @@ void mei_allocate_me_clients_storage(struct mei_device *dev)
/* count how many ME clients we have */ /* count how many ME clients we have */
for_each_set_bit(b, dev->me_clients_map, MEI_CLIENTS_MAX) for_each_set_bit(b, dev->me_clients_map, MEI_CLIENTS_MAX)
dev->num_mei_me_clients++; dev->me_clients_num++;
if (dev->num_mei_me_clients <= 0) if (dev->me_clients_num <= 0)
return ; return ;
...@@ -454,9 +454,9 @@ void mei_allocate_me_clients_storage(struct mei_device *dev) ...@@ -454,9 +454,9 @@ void mei_allocate_me_clients_storage(struct mei_device *dev)
dev->me_clients = NULL; dev->me_clients = NULL;
} }
dev_dbg(&dev->pdev->dev, "memory allocation for ME clients size=%zd.\n", dev_dbg(&dev->pdev->dev, "memory allocation for ME clients size=%zd.\n",
dev->num_mei_me_clients * sizeof(struct mei_me_client)); dev->me_clients_num * sizeof(struct mei_me_client));
/* allocate storage for ME clients representation */ /* allocate storage for ME clients representation */
clients = kcalloc(dev->num_mei_me_clients, clients = kcalloc(dev->me_clients_num,
sizeof(struct mei_me_client), GFP_KERNEL); sizeof(struct mei_me_client), GFP_KERNEL);
if (!clients) { if (!clients) {
dev_dbg(&dev->pdev->dev, "memory allocation for ME clients failed.\n"); dev_dbg(&dev->pdev->dev, "memory allocation for ME clients failed.\n");
...@@ -550,7 +550,7 @@ int mei_find_me_client_index(const struct mei_device *dev, uuid_le cuuid) ...@@ -550,7 +550,7 @@ int mei_find_me_client_index(const struct mei_device *dev, uuid_le cuuid)
{ {
int i, res = -1; int i, res = -1;
for (i = 0; i < dev->num_mei_me_clients; ++i) for (i = 0; i < dev->me_clients_num; ++i)
if (uuid_le_cmp(cuuid, if (uuid_le_cmp(cuuid,
dev->me_clients[i].props.protocol_name) == 0) { dev->me_clients[i].props.protocol_name) == 0) {
res = i; res = i;
......
...@@ -255,13 +255,13 @@ int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl) ...@@ -255,13 +255,13 @@ int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl)
{ {
int i; int i;
if (!dev->num_mei_me_clients) if (!dev->me_clients_num)
return 0; return 0;
if (cl->mei_flow_ctrl_creds > 0) if (cl->mei_flow_ctrl_creds > 0)
return 1; return 1;
for (i = 0; i < dev->num_mei_me_clients; i++) { for (i = 0; i < dev->me_clients_num; i++) {
struct mei_me_client *me_cl = &dev->me_clients[i]; struct mei_me_client *me_cl = &dev->me_clients[i];
if (me_cl->client_id == cl->me_client_id) { if (me_cl->client_id == cl->me_client_id) {
if (me_cl->mei_flow_ctrl_creds) { if (me_cl->mei_flow_ctrl_creds) {
...@@ -290,10 +290,10 @@ int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl) ...@@ -290,10 +290,10 @@ int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl)
{ {
int i; int i;
if (!dev->num_mei_me_clients) if (!dev->me_clients_num)
return -ENOENT; return -ENOENT;
for (i = 0; i < dev->num_mei_me_clients; i++) { for (i = 0; i < dev->me_clients_num; i++) {
struct mei_me_client *me_cl = &dev->me_clients[i]; struct mei_me_client *me_cl = &dev->me_clients[i];
if (me_cl->client_id == cl->me_client_id) { if (me_cl->client_id == cl->me_client_id) {
if (me_cl->props.single_recv_buf != 0) { if (me_cl->props.single_recv_buf != 0) {
......
...@@ -499,7 +499,7 @@ static void add_single_flow_creds(struct mei_device *dev, ...@@ -499,7 +499,7 @@ static void add_single_flow_creds(struct mei_device *dev,
struct mei_me_client *client; struct mei_me_client *client;
int i; int i;
for (i = 0; i < dev->num_mei_me_clients; i++) { for (i = 0; i < dev->me_clients_num; i++) {
client = &dev->me_clients[i]; client = &dev->me_clients[i];
if (client && flow->me_addr == client->client_id) { if (client && flow->me_addr == client->client_id) {
if (client->props.single_recv_buf) { if (client->props.single_recv_buf) {
......
...@@ -277,13 +277,13 @@ int amthi_read(struct mei_device *dev, struct file *file, ...@@ -277,13 +277,13 @@ int amthi_read(struct mei_device *dev, struct file *file,
return -ETIMEDOUT; return -ETIMEDOUT;
} }
for (i = 0; i < dev->num_mei_me_clients; i++) { for (i = 0; i < dev->me_clients_num; i++) {
if (dev->me_clients[i].client_id == if (dev->me_clients[i].client_id ==
dev->iamthif_cl.me_client_id) dev->iamthif_cl.me_client_id)
break; break;
} }
if (i == dev->num_mei_me_clients) { if (i == dev->me_clients_num) {
dev_dbg(&dev->pdev->dev, "amthi client not found.\n"); dev_dbg(&dev->pdev->dev, "amthi client not found.\n");
return -ENODEV; return -ENODEV;
} }
...@@ -409,7 +409,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl) ...@@ -409,7 +409,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl)
dev_dbg(&dev->pdev->dev, "allocation call back successful. host client = %d, ME client = %d\n", dev_dbg(&dev->pdev->dev, "allocation call back successful. host client = %d, ME client = %d\n",
cl->host_client_id, cl->me_client_id); cl->host_client_id, cl->me_client_id);
for (i = 0; i < dev->num_mei_me_clients; i++) { for (i = 0; i < dev->me_clients_num; i++) {
if (dev->me_clients[i].client_id == cl->me_client_id) if (dev->me_clients[i].client_id == cl->me_client_id)
break; break;
...@@ -420,7 +420,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl) ...@@ -420,7 +420,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl)
goto unlock; goto unlock;
} }
if (i == dev->num_mei_me_clients) { if (i == dev->me_clients_num) {
rets = -ENODEV; rets = -ENODEV;
goto unlock; goto unlock;
} }
......
...@@ -240,7 +240,7 @@ static void __devexit mei_remove(struct pci_dev *pdev) ...@@ -240,7 +240,7 @@ static void __devexit mei_remove(struct pci_dev *pdev)
mei_remove_client_from_file_list(dev, dev->iamthif_cl.host_client_id); mei_remove_client_from_file_list(dev, dev->iamthif_cl.host_client_id);
dev->iamthif_current_cb = NULL; dev->iamthif_current_cb = NULL;
dev->num_mei_me_clients = 0; dev->me_clients_num = 0;
mutex_unlock(&dev->device_lock); mutex_unlock(&dev->device_lock);
...@@ -800,7 +800,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, ...@@ -800,7 +800,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
rets = -ENODEV; rets = -ENODEV;
goto unlock_dev; goto unlock_dev;
} }
for (i = 0; i < dev->num_mei_me_clients; i++) { for (i = 0; i < dev->me_clients_num; i++) {
if (dev->me_clients[i].client_id == if (dev->me_clients[i].client_id ==
dev->iamthif_cl.me_client_id) dev->iamthif_cl.me_client_id)
break; break;
...@@ -810,7 +810,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, ...@@ -810,7 +810,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
rets = -ENODEV; rets = -ENODEV;
goto unlock_dev; goto unlock_dev;
} }
if (i == dev->num_mei_me_clients || if (i == dev->me_clients_num ||
(dev->me_clients[i].client_id != (dev->me_clients[i].client_id !=
dev->iamthif_cl.me_client_id)) { dev->iamthif_cl.me_client_id)) {
rets = -ENODEV; rets = -ENODEV;
...@@ -868,7 +868,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, ...@@ -868,7 +868,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
cl->me_client_id); cl->me_client_id);
goto unlock_dev; goto unlock_dev;
} }
for (i = 0; i < dev->num_mei_me_clients; i++) { for (i = 0; i < dev->me_clients_num; i++) {
if (dev->me_clients[i].client_id == if (dev->me_clients[i].client_id ==
cl->me_client_id) cl->me_client_id)
break; break;
...@@ -877,7 +877,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, ...@@ -877,7 +877,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
rets = -ENODEV; rets = -ENODEV;
goto unlock_dev; goto unlock_dev;
} }
if (i == dev->num_mei_me_clients) { if (i == dev->me_clients_num) {
rets = -ENODEV; rets = -ENODEV;
goto unlock_dev; goto unlock_dev;
} }
......
...@@ -236,7 +236,7 @@ struct mei_device { ...@@ -236,7 +236,7 @@ struct mei_device {
struct mei_me_client *me_clients; /* Note: memory has to be allocated */ struct mei_me_client *me_clients; /* Note: memory has to be allocated */
DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX); DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX);
DECLARE_BITMAP(host_clients_map, MEI_CLIENTS_MAX); DECLARE_BITMAP(host_clients_map, MEI_CLIENTS_MAX);
u8 num_mei_me_clients; u8 me_clients_num;
u8 me_client_presentation_num; u8 me_client_presentation_num;
u8 me_client_index; u8 me_client_index;
bool mei_host_buffer_is_empty; bool mei_host_buffer_is_empty;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment