aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorZou Wei <zou_wei@huawei.com>2021-06-08 20:34:59 +0800
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-06-11 21:05:06 +0200
commit6aa12138cd9aeb01308a3da8b23451dcf7f00d52 (patch)
tree860eaf0c65518dc3cc71e3aab2c36df269260d33 /drivers/mtd
parentdt-bindings: mtd: Convert ti, am654-hbmc.txt to YAML schema (diff)
downloadlinux-dev-6aa12138cd9aeb01308a3da8b23451dcf7f00d52.tar.xz
linux-dev-6aa12138cd9aeb01308a3da8b23451dcf7f00d52.zip
mtd: Convert list_for_each to entry variant
convert list_for_each() to list_for_each_entry() where applicable. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1623155699-61935-1-git-send-email-zou_wei@huawei.com
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/chips/chipreg.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mtd/chips/chipreg.c b/drivers/mtd/chips/chipreg.c
index ff86373d7d24..a05e103682a4 100644
--- a/drivers/mtd/chips/chipreg.c
+++ b/drivers/mtd/chips/chipreg.c
@@ -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)
{
- struct list_head *pos;
struct mtd_chip_driver *ret = NULL, *this;
spin_lock(&chip_drvs_lock);
- list_for_each(pos, &chip_drvs_list) {
- this = list_entry(pos, typeof(*this), list);
-
+ list_for_each_entry(this, &chip_drvs_list, list) {
if (!strcmp(this->name, name)) {
ret = this;
break;