Commit 6aa12138 authored by Zou Wei's avatar Zou Wei Committed by Miquel Raynal

mtd: Convert list_for_each to entry variant

convert list_for_each() to list_for_each_entry() where
applicable.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1623155699-61935-1-git-send-email-zou_wei@huawei.com
parent 6947ad67
...@@ -31,14 +31,11 @@ void unregister_mtd_chip_driver(struct mtd_chip_driver *drv) ...@@ -31,14 +31,11 @@ void unregister_mtd_chip_driver(struct mtd_chip_driver *drv)
static struct mtd_chip_driver *get_mtd_chip_driver (const char *name) static struct mtd_chip_driver *get_mtd_chip_driver (const char *name)
{ {
struct list_head *pos;
struct mtd_chip_driver *ret = NULL, *this; struct mtd_chip_driver *ret = NULL, *this;
spin_lock(&chip_drvs_lock); spin_lock(&chip_drvs_lock);
list_for_each(pos, &chip_drvs_list) { list_for_each_entry(this, &chip_drvs_list, list) {
this = list_entry(pos, typeof(*this), list);
if (!strcmp(this->name, name)) { if (!strcmp(this->name, name)) {
ret = this; ret = this;
break; break;
......
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