From ebb108ef93605a68f6f38d5eb407e7d5138e8028 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Tue, 9 Oct 2012 16:50:16 +0200 Subject: mei: rename mei_cl_cb.information to mei_cl_cb.buf_idx rename 'information' member of the struct mei_cl_cb to more self-descriptive 'buf_idx' Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/iorw.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'drivers/misc/mei/iorw.c') diff --git a/drivers/misc/mei/iorw.c b/drivers/misc/mei/iorw.c index fcba98eb892e..20652e140c43 100644 --- a/drivers/misc/mei/iorw.c +++ b/drivers/misc/mei/iorw.c @@ -346,9 +346,9 @@ int amthi_read(struct mei_device *dev, struct file *file, } } /* if the whole message will fit remove it from the list */ - if (cb->information >= *offset && length >= (cb->information - *offset)) + if (cb->buf_idx >= *offset && length >= (cb->buf_idx - *offset)) list_del(&cb->cb_list); - else if (cb->information > 0 && cb->information <= *offset) { + else if (cb->buf_idx > 0 && cb->buf_idx <= *offset) { /* end of the message has been reached */ list_del(&cb->cb_list); rets = 0; @@ -360,18 +360,17 @@ int amthi_read(struct mei_device *dev, struct file *file, dev_dbg(&dev->pdev->dev, "amthi cb->response_buffer size - %d\n", cb->response_buffer.size); - dev_dbg(&dev->pdev->dev, "amthi cb->information - %lu\n", - cb->information); + dev_dbg(&dev->pdev->dev, "amthi cb->buf_idx - %lu\n", cb->buf_idx); /* length is being turncated to PAGE_SIZE, however, - * the information may be longer */ - length = min_t(size_t, length, (cb->information - *offset)); + * the buf_idx may point beyond */ + length = min_t(size_t, length, (cb->buf_idx - *offset)); if (copy_to_user(ubuf, cb->response_buffer.data + *offset, length)) rets = -EFAULT; else { rets = length; - if ((*offset + length) < cb->information) { + if ((*offset + length) < cb->buf_idx) { *offset += length; goto out; } @@ -432,8 +431,8 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl) } dev_dbg(&dev->pdev->dev, "allocation call back data success.\n"); cb->major_file_operations = MEI_READ; - /* make sure information is zero before we start */ - cb->information = 0; + /* make sure buffer index is zero before we start */ + cb->buf_idx = 0; cb->file_private = (void *) cl; cl->read_cb = cb; if (dev->mei_host_buffer_is_empty) { -- cgit v1.2.3