summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/mei/debugfs.c')
-rw-r--r--drivers/misc/mei/debugfs.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index ced5b777c70f..3b032881622d 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -28,10 +28,10 @@ static ssize_t mei_dbgfs_read_meclients(struct file *fp, char __user *ubuf,
size_t cnt, loff_t *ppos)
{
struct mei_device *dev = fp->private_data;
- struct mei_me_client *cl;
+ struct mei_me_client *me_cl;
const size_t bufsz = 1024;
char *buf = kzalloc(bufsz, GFP_KERNEL);
- int i;
+ int i = 0;
int pos = 0;
int ret;
@@ -47,20 +47,19 @@ static ssize_t mei_dbgfs_read_meclients(struct file *fp, char __user *ubuf,
if (dev->dev_state != MEI_DEV_ENABLED)
goto out;
- for (i = 0; i < dev->me_clients_num; i++) {
- cl = &dev->me_clients[i];
+ list_for_each_entry(me_cl, &dev->me_clients, list) {
/* skip me clients that cannot be connected */
- if (cl->props.max_number_of_connections == 0)
+ if (me_cl->props.max_number_of_connections == 0)
continue;
pos += scnprintf(buf + pos, bufsz - pos,
"%2d|%2d|%4d|%pUl|%3d|%7d|\n",
- i, cl->client_id,
- cl->props.fixed_address,
- &cl->props.protocol_name,
- cl->props.max_number_of_connections,
- cl->props.max_msg_length);
+ i++, me_cl->client_id,
+ me_cl->props.fixed_address,
+ &me_cl->props.protocol_name,
+ me_cl->props.max_number_of_connections,
+ me_cl->props.max_msg_length);
}
out:
mutex_unlock(&dev->device_lock);