]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mei: rename variable names 'file_object' to fp
authorTomas Winkler <tomas.winkler@intel.com>
Sun, 7 Feb 2016 21:35:24 +0000 (23:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 22:47:20 +0000 (14:47 -0800)
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: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/amthif.c
drivers/misc/mei/client.c
drivers/misc/mei/interrupt.c
drivers/misc/mei/mei_dev.h

index 16cceedeed9758702fc06060d4828c30ffcf3a05..647edc68884f676969326062327dfa710c59d269 100644 (file)
@@ -98,7 +98,7 @@ struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev,
        struct mei_cl_cb *cb;
 
        list_for_each_entry(cb, &dev->amthif_rd_complete_list.list, list)
-               if (cb->file_object == file)
+               if (cb->fp == file)
                        return cb;
        return NULL;
 }
@@ -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);
 
        dev->iamthif_state = MEI_IAMTHIF_READING;
-       dev->iamthif_file_object = cb->file_object;
+       dev->iamthif_fp = cb->fp;
        dev->iamthif_current_cb = cb;
 
        return 0;
@@ -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_current_cb = cb;
-       dev->iamthif_file_object = cb->file_object;
+       dev->iamthif_fp = cb->fp;
        dev->iamthif_canceled = 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)
                return ret;
 
        if (cb->completed)
-               cb->status = mei_amthif_read_start(cl, cb->file_object);
+               cb->status = mei_amthif_read_start(cl, cb->fp);
 
        return 0;
 }
@@ -280,7 +280,7 @@ int mei_amthif_run_next_cmd(struct mei_device *dev)
 
        dev->iamthif_canceled = false;
        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");
 
@@ -338,7 +338,7 @@ unsigned int mei_amthif_poll(struct mei_device *dev,
        poll_wait(file, &dev->iamthif_cl.wait, wait);
 
        if (dev->iamthif_state == MEI_IAMTHIF_READ_COMPLETE &&
-           dev->iamthif_file_object == file) {
+           dev->iamthif_fp == file) {
 
                mask |= POLLIN | POLLRDNORM;
                mei_amthif_run_next_cmd(dev);
@@ -368,7 +368,7 @@ int mei_amthif_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
                return ret;
 
        if (cb->completed)
-               cb->status = mei_amthif_read_start(cl, cb->file_object);
+               cb->status = mei_amthif_read_start(cl, cb->fp);
 
        return 0;
 }
@@ -469,7 +469,7 @@ static bool mei_clear_list(struct mei_device *dev,
        /* list all list member */
        list_for_each_entry_safe(cb, next, mei_cb_list, list) {
                /* 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 */
                        if (dev->iamthif_current_cb == cb) {
                                dev->iamthif_current_cb = NULL;
@@ -518,7 +518,7 @@ static bool mei_clear_lists(struct mei_device *dev, const struct file *file)
        /* check if iamthif_current_cb not NULL */
        if (dev->iamthif_current_cb && !removed) {
                /* check file and iamthif current cb association */
-               if (dev->iamthif_current_cb->file_object == file) {
+               if (dev->iamthif_current_cb->fp == file) {
                        /* remove cb */
                        mei_io_cb_free(dev->iamthif_current_cb);
                        dev->iamthif_current_cb = NULL;
@@ -541,7 +541,7 @@ int mei_amthif_release(struct mei_device *dev, struct file *file)
        if (dev->iamthif_open_count > 0)
                dev->iamthif_open_count--;
 
-       if (dev->iamthif_file_object == file &&
+       if (dev->iamthif_fp == file &&
            dev->iamthif_state != MEI_IAMTHIF_IDLE) {
 
                dev_dbg(dev->dev, "amthif canceled iamthif state %d\n",
index 4c23caee04ab0723e1f4cbaf9c89e6b26ed2e4d6..c57ac25ce8db8d027ce4514a497e999d01e6f784 100644 (file)
@@ -368,7 +368,7 @@ struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl, enum mei_cb_file_ops type,
                return NULL;
 
        INIT_LIST_HEAD(&cb->list);
-       cb->file_object = fp;
+       cb->fp = fp;
        cb->cl = cl;
        cb->buf_idx = 0;
        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)
        struct mei_cl_cb *cb;
 
        list_for_each_entry(cb, &cl->rd_completed, list)
-               if (!fp || fp == cb->file_object)
+               if (!fp || fp == cb->fp)
                        return cb;
 
        return NULL;
@@ -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;
 
        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);
 
 
        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);
 }
 
index 78978193d19be5e7b1cb1df67f7d4c388b02e608..37c8f0e1438732d471d89a99e1533977f6643ebb 100644 (file)
@@ -506,7 +506,7 @@ void mei_timer(struct work_struct *work)
                        mei_io_cb_free(dev->iamthif_current_cb);
                        dev->iamthif_current_cb = NULL;
 
-                       dev->iamthif_file_object = NULL;
+                       dev->iamthif_fp = NULL;
                        mei_amthif_run_next_cmd(dev);
                }
        }
index 947e0a70577a2a232885dd0a60ef9a60a2a2ff9b..3acbbb49d08ca009633f3622ea329c4c9a586d1f 100644 (file)
@@ -179,7 +179,7 @@ struct mei_cl;
  * @fop_type: file operation type
  * @buf: buffer for data associated with the callback
  * @buf_idx: last read index
- * @file_object: pointer to file structure
+ * @fp: pointer to file structure
  * @status: io status of the cb
  * @internal: communication between driver and FW flag
  * @completed: the transfer or reception has completed
@@ -190,7 +190,7 @@ struct mei_cl_cb {
        enum mei_cb_file_ops fop_type;
        struct mei_msg_data buf;
        size_t buf_idx;
-       const struct file *file_object;
+       const struct file *fp;
        int status;
        u32 internal:1;
        u32 completed:1;
@@ -407,7 +407,7 @@ const char *mei_pg_state_str(enum mei_pg_state state);
  *
  * @amthif_cmd_list : amthif list for cmd waiting
  * @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_current_cb : amthif current operation callback
  * @iamthif_open_count : number of opened amthif connections
@@ -497,7 +497,7 @@ struct mei_device {
        struct mei_cl_cb amthif_cmd_list;
        /* driver managed amthif list for reading completed amthif cmd data */
        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_cb *iamthif_current_cb;
        long iamthif_open_count;