Skip to contentSkip to conversation

Major warning fixes for sparc64 [3/4]

PATCH Applied Joshua Kwan 2 participants 2 messages May 6, 2004 – May 7, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Major warning fixes for sparc64 [3/4]

patch 3: Fixes a pile of lvalue casts in asm-sparc64/pgalloc.h.

This is a backport of DaveM's fix for 2.6's pgalloc.h, which is slightly different due to the different interfaces used. I think I got it right though, and I've compiled a kernel with this patch that seems to work alright.

I probably got something wrong anyway, though. :)

Signature · 1 line
Joshua Kwan
include/asm-sparc64/pgalloc.h renamed from include/asm-sparc64/pgalloc.h~ +6 -6
@@ -147,11 +147,11 @@
 	struct page *page = virt_to_page(pgd);
 
 	if (!page->pprev_hash) {
-		(unsigned long *)page->next_hash = pgd_quicklist;
+		page->next_hash = (struct page *)pgd_quicklist;
 		pgd_quicklist = (unsigned long *)page;
 	}
-	(unsigned long)page->pprev_hash |=
-		(((unsigned long)pgd & (PAGE_SIZE / 2)) ? 2 : 1);
+	page->pprev_hash = (struct page **)(((unsigned long)page->pprev_hash) |
+	    (((unsigned long)pgd & (PAGE_SIZE / 2)) ? 2 : 1));
 	pgd_cache_size++;
 }
 
@@ -169,7 +169,7 @@
 			off = PAGE_SIZE / 2;
 			mask &= ~2;
 		}
-		(unsigned long)ret->pprev_hash = mask;
+		ret->pprev_hash = (struct page **)mask;
 		if (!mask)
 			pgd_quicklist = (unsigned long *)ret->next_hash;
                 ret = (struct page *)(__page_address(ret) + off);
@@ -180,8 +180,8 @@
 		if (page) {
 			ret = (struct page *)page_address(page);
 			clear_page(ret);
-			(unsigned long)page->pprev_hash = 2;
-			(unsigned long *)page->next_hash = pgd_quicklist;
+			page->pprev_hash = (struct page **) 2UL;
+			page->next_hash = (struct page *) pgd_quicklist;
 			pgd_quicklist = (unsigned long *)page;
 			pgd_cache_size++;
 		}
#1 lore raw
Quoted 6 lines · On Thu, 6 May 2004 15:37:52 -0700 [email protected] (Joshua Kwan) wrote:

patch 3: Fixes a pile of lvalue casts in asm-sparc64/pgalloc.h.

This is a backport of DaveM's fix for 2.6's pgalloc.h, which is slightly different due to the different interfaces used. I think I got it right though, and I've compiled a kernel with this patch that seems to work alright.

Applied.