Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1286636 > unrolled thread
| Started by | Geliang Tang <geliangtang@163.com> |
|---|---|
| First post | 2015-12-08 17:10 +0100 |
| Last post | 2015-12-11 04:00 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] kexec: use list_for_each_entry_safe in kimage_free_page_list Geliang Tang <geliangtang@163.com> - 2015-12-08 17:10 +0100
Re: [PATCH] kexec: use list_for_each_entry_safe in kimage_free_page_list Baoquan He <bhe@redhat.com> - 2015-12-11 04:00 +0100
| From | Geliang Tang <geliangtang@163.com> |
|---|---|
| Date | 2015-12-08 17:10 +0100 |
| Subject | [PATCH] kexec: use list_for_each_entry_safe in kimage_free_page_list |
| Message-ID | <qDsZZ-4yl-49@gated-at.bofh.it> |
Use list_for_each_entry_safe() instead of list_for_each_safe() to
simplify the code.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
kernel/kexec_core.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 11b64a6..f3951c7 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -310,12 +310,9 @@ static void kimage_free_pages(struct page *page)
void kimage_free_page_list(struct list_head *list)
{
- struct list_head *pos, *next;
+ struct page *page, *next;
- list_for_each_safe(pos, next, list) {
- struct page *page;
-
- page = list_entry(pos, struct page, lru);
+ list_for_each_entry_safe(page, next, list, lru) {
list_del(&page->lru);
kimage_free_pages(page);
}
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Baoquan He <bhe@redhat.com> |
|---|---|
| Date | 2015-12-11 04:00 +0100 |
| Subject | Re: [PATCH] kexec: use list_for_each_entry_safe in kimage_free_page_list |
| Message-ID | <qEm66-6uo-11@gated-at.bofh.it> |
| In reply to | #1286636 |
On 12/09/15 at 12:08am, Geliang Tang wrote:
> Use list_for_each_entry_safe() instead of list_for_each_safe() to
> simplify the code.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> kernel/kexec_core.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 11b64a6..f3951c7 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -310,12 +310,9 @@ static void kimage_free_pages(struct page *page)
>
> void kimage_free_page_list(struct list_head *list)
> {
> - struct list_head *pos, *next;
> + struct page *page, *next;
>
> - list_for_each_safe(pos, next, list) {
> - struct page *page;
> -
> - page = list_entry(pos, struct page, lru);
> + list_for_each_entry_safe(page, next, list, lru) {
A small improvement, seems better. Ack it.
Please also send kexec mailing list if you have kexec related patchs so
that more people are attracted:
kexec@lists.infradead.org
Acked-by: Baoquan He <bhe@redhat.com>
Thanks
Baoquan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web