aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2011-12-04 09:16:27 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-08 18:00:44 -0500
commit3a5352fc9d316fe1be18daf80571e80805e06f11 (patch)
tree4023316df7c0c410748c9a27cf3b50e49738858e
parent91762057f439bb0adb33ca857b6022fda4b1fd69 (diff)
staging/mei: Don't check if loop cursor is null
list_for_each_entry_safe(pos, next, &head, list) if (pos) { .... } This check isn't needed. The list cursor in a list_for_each() loop is always a valid pointer Cc: Oren Weil <oren.jer.weil@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/mei/init.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/staging/mei/init.c b/drivers/staging/mei/init.c
index 32cf05ee5fec..ce102248e3bb 100644
--- a/drivers/staging/mei/init.c
+++ b/drivers/staging/mei/init.c
@@ -48,11 +48,11 @@ void mei_io_list_init(struct mei_io_list *list)
48 */ 48 */
49void mei_io_list_flush(struct mei_io_list *list, struct mei_cl *cl) 49void mei_io_list_flush(struct mei_io_list *list, struct mei_cl *cl)
50{ 50{
51 struct mei_cl_cb *pos = NULL; 51 struct mei_cl_cb *pos;
52 struct mei_cl_cb *next = NULL; 52 struct mei_cl_cb *next;
53 53
54 list_for_each_entry_safe(pos, next, &list->mei_cb.cb_list, cb_list) { 54 list_for_each_entry_safe(pos, next, &list->mei_cb.cb_list, cb_list) {
55 if (pos) { 55 if (pos->file_private) {
56 struct mei_cl *cl_tmp; 56 struct mei_cl *cl_tmp;
57 cl_tmp = (struct mei_cl *)pos->file_private; 57 cl_tmp = (struct mei_cl *)pos->file_private;
58 if (mei_cl_cmp_id(cl, cl_tmp)) 58 if (mei_cl_cmp_id(cl, cl_tmp))
@@ -332,11 +332,8 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
332 /* remove all waiting requests */ 332 /* remove all waiting requests */
333 list_for_each_entry_safe(cb_pos, cb_next, 333 list_for_each_entry_safe(cb_pos, cb_next,
334 &dev->write_list.mei_cb.cb_list, cb_list) { 334 &dev->write_list.mei_cb.cb_list, cb_list) {
335 if (cb_pos) { 335 list_del(&cb_pos->cb_list);
336 list_del(&cb_pos->cb_list); 336 mei_free_cb_private(cb_pos);
337 mei_free_cb_private(cb_pos);
338 cb_pos = NULL;
339 }
340 } 337 }
341} 338}
342 339