diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2012-11-01 15:17:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-01 15:31:19 -0400 |
commit | 15ea19105bdeef36820ade6754b9b7f1e3511e98 (patch) | |
tree | 0b1cc24f910c400f2f7d823192f6b13e735d236f | |
parent | 19838fb85306905a373b6449c1428791d653fc21 (diff) |
mei: mei_clear_list: kill file_temp
file_temp is used only once, so there is no any benefit of creating
a temporary variable
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/mei/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index f69e0856f982..d8221a5a7ee8 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -103,18 +103,16 @@ static DEFINE_MUTEX(mei_mutex); | |||
103 | * returns true if callback removed from the list, false otherwise | 103 | * returns true if callback removed from the list, false otherwise |
104 | */ | 104 | */ |
105 | static bool mei_clear_list(struct mei_device *dev, | 105 | static bool mei_clear_list(struct mei_device *dev, |
106 | struct file *file, struct list_head *mei_cb_list) | 106 | const struct file *file, struct list_head *mei_cb_list) |
107 | { | 107 | { |
108 | struct mei_cl_cb *cb_pos = NULL; | 108 | struct mei_cl_cb *cb_pos = NULL; |
109 | struct mei_cl_cb *cb_next = NULL; | 109 | struct mei_cl_cb *cb_next = NULL; |
110 | struct file *file_temp; | ||
111 | bool removed = false; | 110 | bool removed = false; |
112 | 111 | ||
113 | /* list all list member */ | 112 | /* list all list member */ |
114 | list_for_each_entry_safe(cb_pos, cb_next, mei_cb_list, list) { | 113 | list_for_each_entry_safe(cb_pos, cb_next, mei_cb_list, list) { |
115 | file_temp = (struct file *)cb_pos->file_object; | ||
116 | /* check if list member associated with a file */ | 114 | /* check if list member associated with a file */ |
117 | if (file_temp == file) { | 115 | if (file == cb_pos->file_object) { |
118 | /* remove member from the list */ | 116 | /* remove member from the list */ |
119 | list_del(&cb_pos->list); | 117 | list_del(&cb_pos->list); |
120 | /* check if cb equal to current iamthif cb */ | 118 | /* check if cb equal to current iamthif cb */ |