[MTD] Use list_for_each_entry[_safe] where appropriate.
Janitorial work to remove temporary pointers and make some functions a bit more readable. Signed-off-by: Chris Malley <mail@chrismalley.co.uk> Reviewed-By: Jörn Engel <joern@logfs.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:

committed by
David Woodhouse

parent
59018b6d2a
commit
71a928c0e5
@@ -70,9 +70,8 @@ int add_mtd_device(struct mtd_info *mtd)
|
||||
DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->name);
|
||||
/* No need to get a refcount on the module containing
|
||||
the notifier, since we hold the mtd_table_mutex */
|
||||
list_for_each_entry(not, &mtd_notifiers, list) {
|
||||
list_for_each_entry(not, &mtd_notifiers, list)
|
||||
not->add(mtd);
|
||||
}
|
||||
|
||||
mutex_unlock(&mtd_table_mutex);
|
||||
/* We _know_ we aren't being removed, because
|
||||
@@ -114,9 +113,8 @@ int del_mtd_device (struct mtd_info *mtd)
|
||||
|
||||
/* No need to get a refcount on the module containing
|
||||
the notifier, since we hold the mtd_table_mutex */
|
||||
list_for_each_entry(not, &mtd_notifiers, list) {
|
||||
list_for_each_entry(not, &mtd_notifiers, list)
|
||||
not->remove(mtd);
|
||||
}
|
||||
|
||||
mtd_table[mtd->index] = NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user