diff options
Diffstat (limited to 'drivers/misc/mei/debugfs.c')
-rw-r--r-- | drivers/misc/mei/debugfs.c | 19 |
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, | |||
28 | size_t cnt, loff_t *ppos) | 28 | size_t cnt, loff_t *ppos) |
29 | { | 29 | { |
30 | struct mei_device *dev = fp->private_data; | 30 | struct mei_device *dev = fp->private_data; |
31 | struct mei_me_client *cl; | 31 | struct mei_me_client *me_cl; |
32 | const size_t bufsz = 1024; | 32 | const size_t bufsz = 1024; |
33 | char *buf = kzalloc(bufsz, GFP_KERNEL); | 33 | char *buf = kzalloc(bufsz, GFP_KERNEL); |
34 | int i; | 34 | int i = 0; |
35 | int pos = 0; | 35 | int pos = 0; |
36 | int ret; | 36 | int ret; |
37 | 37 | ||
@@ -47,20 +47,19 @@ static ssize_t mei_dbgfs_read_meclients(struct file *fp, char __user *ubuf, | |||
47 | if (dev->dev_state != MEI_DEV_ENABLED) | 47 | if (dev->dev_state != MEI_DEV_ENABLED) |
48 | goto out; | 48 | goto out; |
49 | 49 | ||
50 | for (i = 0; i < dev->me_clients_num; i++) { | 50 | list_for_each_entry(me_cl, &dev->me_clients, list) { |
51 | cl = &dev->me_clients[i]; | ||
52 | 51 | ||
53 | /* skip me clients that cannot be connected */ | 52 | /* skip me clients that cannot be connected */ |
54 | if (cl->props.max_number_of_connections == 0) | 53 | if (me_cl->props.max_number_of_connections == 0) |
55 | continue; | 54 | continue; |
56 | 55 | ||
57 | pos += scnprintf(buf + pos, bufsz - pos, | 56 | pos += scnprintf(buf + pos, bufsz - pos, |
58 | "%2d|%2d|%4d|%pUl|%3d|%7d|\n", | 57 | "%2d|%2d|%4d|%pUl|%3d|%7d|\n", |
59 | i, cl->client_id, | 58 | i++, me_cl->client_id, |
60 | cl->props.fixed_address, | 59 | me_cl->props.fixed_address, |
61 | &cl->props.protocol_name, | 60 | &me_cl->props.protocol_name, |
62 | cl->props.max_number_of_connections, | 61 | me_cl->props.max_number_of_connections, |
63 | cl->props.max_msg_length); | 62 | me_cl->props.max_msg_length); |
64 | } | 63 | } |
65 | out: | 64 | out: |
66 | mutex_unlock(&dev->device_lock); | 65 | mutex_unlock(&dev->device_lock); |