2003-05-10 07:58:04

by Zwane Mwaikambo

[permalink] [raw]
Subject: [PATCH][2.5] small cleanup for __rmqueue

Removes an extra initialisation and general nitpicking.

Index: linux-2.5.69/mm/page_alloc.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.69/mm/page_alloc.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 page_alloc.c
--- linux-2.5.69/mm/page_alloc.c 6 May 2003 12:21:35 -0000 1.1.1.1
+++ linux-2.5.69/mm/page_alloc.c 10 May 2003 04:48:46 -0000
@@ -336,21 +336,17 @@ static void prep_new_page(struct page *p
static struct page *__rmqueue(struct zone *zone, unsigned int order)
{
struct free_area * area;
- unsigned int current_order = order;
- struct list_head *head, *curr;
+ unsigned int current_order;
struct page *page;
unsigned int index;

- for (current_order=order; current_order < MAX_ORDER; ++current_order) {
+ for (current_order = order; current_order < MAX_ORDER; ++current_order) {
area = zone->free_area + current_order;
- head = &area->free_list;
- curr = head->next;
-
if (list_empty(&area->free_list))
continue;

- page = list_entry(curr, struct page, list);
- list_del(curr);
+ page = list_entry(area->free_list.next, struct page, list);
+ list_del(&page->list);
index = page - zone->zone_mem_map;
if (current_order != MAX_ORDER-1)
MARK_USED(index, current_order, area);

--
function.linuxpower.ca


2003-05-10 08:03:27

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [PATCH][2.5] small cleanup for __rmqueue

On Sat, May 10, 2003 at 03:59:31AM -0400, Zwane Mwaikambo wrote:
> Removes an extra initialisation and general nitpicking.

Looks good. I like the elimination of the superfluous variables.


-- wli