Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Zou Wei and committed by
Miquel Raynal
6aa12138 6947ad67

+1 -4
+1 -4
drivers/mtd/chips/chipreg.c
··· 31 31 32 32 static struct mtd_chip_driver *get_mtd_chip_driver (const char *name) 33 33 { 34 - struct list_head *pos; 35 34 struct mtd_chip_driver *ret = NULL, *this; 36 35 37 36 spin_lock(&chip_drvs_lock); 38 37 39 - list_for_each(pos, &chip_drvs_list) { 40 - this = list_entry(pos, typeof(*this), list); 41 - 38 + list_for_each_entry(this, &chip_drvs_list, list) { 42 39 if (!strcmp(this->name, name)) { 43 40 ret = this; 44 41 break;