projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6947ad6
)
mtd: Convert list_for_each to entry variant
author
Zou Wei
<zou_wei@huawei.com>
Tue, 8 Jun 2021 12:34:59 +0000
(20:34 +0800)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Fri, 11 Jun 2021 19:05:06 +0000
(21:05 +0200)
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
drivers/mtd/chips/chipreg.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/chips/chipreg.c
b/drivers/mtd/chips/chipreg.c
index ff86373d7d2439fb18dd19428fc7fb0890504b39..a05e103682a483d66bdc716cfcb1effc8ec02bb3 100644
(file)
--- 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;