projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5db652c
)
nvmem: use list_for_each_entry_safe in nvmem_device_remove_all_cells()
author
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Fri, 21 Sep 2018 13:40:05 +0000
(06:40 -0700)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 28 Sep 2018 13:14:53 +0000
(15:14 +0200)
Use the provided helper for iterating over list entries without having
to use the list_entry() macro.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c
patch
|
blob
|
history
diff --git
a/drivers/nvmem/core.c
b/drivers/nvmem/core.c
index 72313a1d215f7314d5f7785c42632e31c9a3e06a..0e963d83a0990bca433899c77a452ab0eb74ac07 100644
(file)
--- a/
drivers/nvmem/core.c
+++ b/
drivers/nvmem/core.c
@@
-308,14
+308,11
@@
static void nvmem_cell_drop(struct nvmem_cell *cell)
static void nvmem_device_remove_all_cells(const struct nvmem_device *nvmem)
{
- struct nvmem_cell *cell;
- struct list_head *p, *n;
+ struct nvmem_cell *cell, *p;
- list_for_each_safe(p, n, &nvmem_cells) {
- cell = list_entry(p, struct nvmem_cell, node);
+ list_for_each_entry_safe(cell, p, &nvmem_cells, node)
if (cell->nvmem == nvmem)
nvmem_cell_drop(cell);
- }
}
static void nvmem_cell_add(struct nvmem_cell *cell)