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

mei: rename variable names 'file_object' to fp

The driver uses three names file, fp, and file_object for
struct file type. To improve code clarity and adjust to my taste
rename file_object to more common and shorter fp.
Reviewed-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f23e2cc4
...@@ -98,7 +98,7 @@ struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev, ...@@ -98,7 +98,7 @@ struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev,
struct mei_cl_cb *cb; struct mei_cl_cb *cb;
list_for_each_entry(cb, &dev->amthif_rd_complete_list.list, list) list_for_each_entry(cb, &dev->amthif_rd_complete_list.list, list)
if (cb->file_object == file) if (cb->fp == file)
return cb; return cb;
return NULL; return NULL;
} }
...@@ -224,7 +224,7 @@ static int mei_amthif_read_start(struct mei_cl *cl, const struct file *file) ...@@ -224,7 +224,7 @@ static int mei_amthif_read_start(struct mei_cl *cl, const struct file *file)
list_add_tail(&cb->list, &dev->ctrl_wr_list.list); list_add_tail(&cb->list, &dev->ctrl_wr_list.list);
dev->iamthif_state = MEI_IAMTHIF_READING; dev->iamthif_state = MEI_IAMTHIF_READING;
dev->iamthif_file_object = cb->file_object; dev->iamthif_fp = cb->fp;
dev->iamthif_current_cb = cb; dev->iamthif_current_cb = cb;
return 0; return 0;
...@@ -253,7 +253,7 @@ static int mei_amthif_send_cmd(struct mei_cl *cl, struct mei_cl_cb *cb) ...@@ -253,7 +253,7 @@ static int mei_amthif_send_cmd(struct mei_cl *cl, struct mei_cl_cb *cb)
dev->iamthif_state = MEI_IAMTHIF_WRITING; dev->iamthif_state = MEI_IAMTHIF_WRITING;
dev->iamthif_current_cb = cb; dev->iamthif_current_cb = cb;
dev->iamthif_file_object = cb->file_object; dev->iamthif_fp = cb->fp;
dev->iamthif_canceled = false; dev->iamthif_canceled = false;
ret = mei_cl_write(cl, cb, false); ret = mei_cl_write(cl, cb, false);
...@@ -261,7 +261,7 @@ static int mei_amthif_send_cmd(struct mei_cl *cl, struct mei_cl_cb *cb) ...@@ -261,7 +261,7 @@ static int mei_amthif_send_cmd(struct mei_cl *cl, struct mei_cl_cb *cb)
return ret; return ret;
if (cb->completed) if (cb->completed)
cb->status = mei_amthif_read_start(cl, cb->file_object); cb->status = mei_amthif_read_start(cl, cb->fp);
return 0; return 0;
} }
...@@ -280,7 +280,7 @@ int mei_amthif_run_next_cmd(struct mei_device *dev) ...@@ -280,7 +280,7 @@ int mei_amthif_run_next_cmd(struct mei_device *dev)
dev->iamthif_canceled = false; dev->iamthif_canceled = false;
dev->iamthif_state = MEI_IAMTHIF_IDLE; dev->iamthif_state = MEI_IAMTHIF_IDLE;
dev->iamthif_file_object = NULL; dev->iamthif_fp = NULL;
dev_dbg(dev->dev, "complete amthif cmd_list cb.\n"); dev_dbg(dev->dev, "complete amthif cmd_list cb.\n");
...@@ -338,7 +338,7 @@ unsigned int mei_amthif_poll(struct mei_device *dev, ...@@ -338,7 +338,7 @@ unsigned int mei_amthif_poll(struct mei_device *dev,
poll_wait(file, &dev->iamthif_cl.wait, wait); poll_wait(file, &dev->iamthif_cl.wait, wait);
if (dev->iamthif_state == MEI_IAMTHIF_READ_COMPLETE && if (dev->iamthif_state == MEI_IAMTHIF_READ_COMPLETE &&
dev->iamthif_file_object == file) { dev->iamthif_fp == file) {
mask |= POLLIN | POLLRDNORM; mask |= POLLIN | POLLRDNORM;
mei_amthif_run_next_cmd(dev); mei_amthif_run_next_cmd(dev);
...@@ -368,7 +368,7 @@ int mei_amthif_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb, ...@@ -368,7 +368,7 @@ int mei_amthif_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
return ret; return ret;
if (cb->completed) if (cb->completed)
cb->status = mei_amthif_read_start(cl, cb->file_object); cb->status = mei_amthif_read_start(cl, cb->fp);
return 0; return 0;
} }
...@@ -469,7 +469,7 @@ static bool mei_clear_list(struct mei_device *dev, ...@@ -469,7 +469,7 @@ static bool mei_clear_list(struct mei_device *dev,
/* list all list member */ /* list all list member */
list_for_each_entry_safe(cb, next, mei_cb_list, list) { list_for_each_entry_safe(cb, next, mei_cb_list, list) {
/* check if list member associated with a file */ /* check if list member associated with a file */
if (file == cb->file_object) { if (file == cb->fp) {
/* check if cb equal to current iamthif cb */ /* check if cb equal to current iamthif cb */
if (dev->iamthif_current_cb == cb) { if (dev->iamthif_current_cb == cb) {
dev->iamthif_current_cb = NULL; dev->iamthif_current_cb = NULL;
...@@ -518,7 +518,7 @@ static bool mei_clear_lists(struct mei_device *dev, const struct file *file) ...@@ -518,7 +518,7 @@ static bool mei_clear_lists(struct mei_device *dev, const struct file *file)
/* check if iamthif_current_cb not NULL */ /* check if iamthif_current_cb not NULL */
if (dev->iamthif_current_cb && !removed) { if (dev->iamthif_current_cb && !removed) {
/* check file and iamthif current cb association */ /* check file and iamthif current cb association */
if (dev->iamthif_current_cb->file_object == file) { if (dev->iamthif_current_cb->fp == file) {
/* remove cb */ /* remove cb */
mei_io_cb_free(dev->iamthif_current_cb); mei_io_cb_free(dev->iamthif_current_cb);
dev->iamthif_current_cb = NULL; dev->iamthif_current_cb = NULL;
...@@ -541,7 +541,7 @@ int mei_amthif_release(struct mei_device *dev, struct file *file) ...@@ -541,7 +541,7 @@ int mei_amthif_release(struct mei_device *dev, struct file *file)
if (dev->iamthif_open_count > 0) if (dev->iamthif_open_count > 0)
dev->iamthif_open_count--; dev->iamthif_open_count--;
if (dev->iamthif_file_object == file && if (dev->iamthif_fp == file &&
dev->iamthif_state != MEI_IAMTHIF_IDLE) { dev->iamthif_state != MEI_IAMTHIF_IDLE) {
dev_dbg(dev->dev, "amthif canceled iamthif state %d\n", dev_dbg(dev->dev, "amthif canceled iamthif state %d\n",
......
...@@ -368,7 +368,7 @@ struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl, enum mei_cb_file_ops type, ...@@ -368,7 +368,7 @@ struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl, enum mei_cb_file_ops type,
return NULL; return NULL;
INIT_LIST_HEAD(&cb->list); INIT_LIST_HEAD(&cb->list);
cb->file_object = fp; cb->fp = fp;
cb->cl = cl; cb->cl = cl;
cb->buf_idx = 0; cb->buf_idx = 0;
cb->fop_type = type; cb->fop_type = type;
...@@ -486,7 +486,7 @@ struct mei_cl_cb *mei_cl_read_cb(const struct mei_cl *cl, const struct file *fp) ...@@ -486,7 +486,7 @@ struct mei_cl_cb *mei_cl_read_cb(const struct mei_cl *cl, const struct file *fp)
struct mei_cl_cb *cb; struct mei_cl_cb *cb;
list_for_each_entry(cb, &cl->rd_completed, list) list_for_each_entry(cb, &cl->rd_completed, list)
if (!fp || fp == cb->file_object) if (!fp || fp == cb->fp)
return cb; return cb;
return NULL; return NULL;
...@@ -504,12 +504,12 @@ void mei_cl_read_cb_flush(const struct mei_cl *cl, const struct file *fp) ...@@ -504,12 +504,12 @@ void mei_cl_read_cb_flush(const struct mei_cl *cl, const struct file *fp)
struct mei_cl_cb *cb, *next; struct mei_cl_cb *cb, *next;
list_for_each_entry_safe(cb, next, &cl->rd_completed, list) list_for_each_entry_safe(cb, next, &cl->rd_completed, list)
if (!fp || fp == cb->file_object) if (!fp || fp == cb->fp)
mei_io_cb_free(cb); mei_io_cb_free(cb);
list_for_each_entry_safe(cb, next, &cl->rd_pending, list) list_for_each_entry_safe(cb, next, &cl->rd_pending, list)
if (!fp || fp == cb->file_object) if (!fp || fp == cb->fp)
mei_io_cb_free(cb); mei_io_cb_free(cb);
} }
......
...@@ -506,7 +506,7 @@ void mei_timer(struct work_struct *work) ...@@ -506,7 +506,7 @@ void mei_timer(struct work_struct *work)
mei_io_cb_free(dev->iamthif_current_cb); mei_io_cb_free(dev->iamthif_current_cb);
dev->iamthif_current_cb = NULL; dev->iamthif_current_cb = NULL;
dev->iamthif_file_object = NULL; dev->iamthif_fp = NULL;
mei_amthif_run_next_cmd(dev); mei_amthif_run_next_cmd(dev);
} }
} }
......
...@@ -179,7 +179,7 @@ struct mei_cl; ...@@ -179,7 +179,7 @@ struct mei_cl;
* @fop_type: file operation type * @fop_type: file operation type
* @buf: buffer for data associated with the callback * @buf: buffer for data associated with the callback
* @buf_idx: last read index * @buf_idx: last read index
* @file_object: pointer to file structure * @fp: pointer to file structure
* @status: io status of the cb * @status: io status of the cb
* @internal: communication between driver and FW flag * @internal: communication between driver and FW flag
* @completed: the transfer or reception has completed * @completed: the transfer or reception has completed
...@@ -190,7 +190,7 @@ struct mei_cl_cb { ...@@ -190,7 +190,7 @@ struct mei_cl_cb {
enum mei_cb_file_ops fop_type; enum mei_cb_file_ops fop_type;
struct mei_msg_data buf; struct mei_msg_data buf;
size_t buf_idx; size_t buf_idx;
const struct file *file_object; const struct file *fp;
int status; int status;
u32 internal:1; u32 internal:1;
u32 completed:1; u32 completed:1;
...@@ -407,7 +407,7 @@ const char *mei_pg_state_str(enum mei_pg_state state); ...@@ -407,7 +407,7 @@ const char *mei_pg_state_str(enum mei_pg_state state);
* *
* @amthif_cmd_list : amthif list for cmd waiting * @amthif_cmd_list : amthif list for cmd waiting
* @amthif_rd_complete_list : amthif list for reading completed cmd data * @amthif_rd_complete_list : amthif list for reading completed cmd data
* @iamthif_file_object : file for current amthif operation * @iamthif_fp : file for current amthif operation
* @iamthif_cl : amthif host client * @iamthif_cl : amthif host client
* @iamthif_current_cb : amthif current operation callback * @iamthif_current_cb : amthif current operation callback
* @iamthif_open_count : number of opened amthif connections * @iamthif_open_count : number of opened amthif connections
...@@ -497,7 +497,7 @@ struct mei_device { ...@@ -497,7 +497,7 @@ struct mei_device {
struct mei_cl_cb amthif_cmd_list; struct mei_cl_cb amthif_cmd_list;
/* driver managed amthif list for reading completed amthif cmd data */ /* driver managed amthif list for reading completed amthif cmd data */
struct mei_cl_cb amthif_rd_complete_list; struct mei_cl_cb amthif_rd_complete_list;
const struct file *iamthif_file_object; const struct file *iamthif_fp;
struct mei_cl iamthif_cl; struct mei_cl iamthif_cl;
struct mei_cl_cb *iamthif_current_cb; struct mei_cl_cb *iamthif_current_cb;
long iamthif_open_count; long iamthif_open_count;
......
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