All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Fernando Alencar Maróstica" <famarost@unimep.br>
To: David Weinehall <tao@acc.umu.se>
Cc: fadel@ferasoft.com.br, linux-kernel@vger.kernel.org
Subject: [PATCH 2.0] Fixed kernel stuff
Date: 15 Oct 2002 17:02:37 -0200	[thread overview]
Message-ID: <1034708558.427.0.camel@nitrogenium> (raw)
In-Reply-To: <20021014220527.GU26715@khan.acc.umu.se>

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

Hello all, specially David 

I think this patch is trivial enough to be accepted, but...

This patch fixed some stuff:
	* Fixed warning in script/lxdialog/menubox.c
	* Fixed warning in script/lxdialog/textbox.c
	* Small VM updates ...

Please apply.


best regards,

-- 
Fernando Alencar Maróstica
Graduate Student, Computer Science
Linux Register User Id #281457

University Methodist of Piracicaba
Departament of Computer Science
home: http://www.unimep.br/~famarost


[-- Attachment #2: linux-2.0.40-rc6.patch --]
[-- Type: text/x-patch, Size: 7570 bytes --]

diff -urN linux-2.0.39/CREDITS linux-2.0.39-patch/CREDITS
--- linux-2.0.39/CREDITS	Tue Jan  9 19:29:20 2001
+++ linux-2.0.39-patch/CREDITS	Tue Oct 15 13:22:10 2002
@@ -1409,6 +1409,16 @@
 S: Santa Clara, California 95051
 S: USA
 
+N: Fernando Alencar Maróstica
+E: famarost@unimep.br
+W: http://www.unimep.br/~famarost
+D: Miscellaneous kernel hacker
+S: UNIMEP University Methodist of Piracicaba
+S: Departament of Computer Science
+S: Rodovia do Açucar, Km 156
+S: 13400-911 - Piracicaba - São Paulo
+S: Brazil
+
 N: Jeff Tranter
 E: Jeff_Tranter@Mitel.COM
 D: Enhancements to Joystick driver
diff -urN linux-2.0.39/include/asm-i386/page.h linux-2.0.39-patch/include/asm-i386/page.h
--- linux-2.0.39/include/asm-i386/page.h	Sun Jun 13 14:21:03 1999
+++ linux-2.0.39-patch/include/asm-i386/page.h	Sun Oct 13 12:42:04 2002
@@ -11,6 +11,9 @@
 
 #define STRICT_MM_TYPECHECKS
 
+#define clear_page(page)	memset((void *)(page), 0, PAGE_SIZE)
+#define copy_page(to,from)	memcpy((void *)(to), (void *)(from), PAGE_SIZE)
+
 #ifdef STRICT_MM_TYPECHECKS
 /*
  * These are used to make use of C type-checking..
diff -urN linux-2.0.39/include/asm-i386/pgtable.h linux-2.0.39-patch/include/asm-i386/pgtable.h
--- linux-2.0.39/include/asm-i386/pgtable.h	Wed Aug 25 19:08:27 1999
+++ linux-2.0.39-patch/include/asm-i386/pgtable.h	Sun Oct 13 13:08:24 2002
@@ -229,7 +229,7 @@
  * area for the same reason. ;)
  */
 #define VMALLOC_OFFSET	(8*1024*1024)
-#define VMALLOC_START ((high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
 #define VMALLOC_VMADDR(x) (TASK_SIZE + (unsigned long)(x))
 
 /*
@@ -302,7 +302,7 @@
 
 #define BAD_PAGETABLE __bad_pagetable()
 #define BAD_PAGE __bad_page()
-#define ZERO_PAGE ((unsigned long) empty_zero_page)
+#define ZERO_PAGE(vaddr) ((unsigned long) empty_zero_page)
 
 /* number of bits that fit into a memory pointer */
 #define BITS_PER_PTR			(8*sizeof(unsigned long))
diff -urN linux-2.0.39/mm/filemap.c linux-2.0.39-patch/mm/filemap.c
--- linux-2.0.39/mm/filemap.c	Wed Jun  3 19:17:50 1998
+++ linux-2.0.39-patch/mm/filemap.c	Sun Oct 13 12:56:38 2002
@@ -817,7 +817,7 @@
 	/*
 	 * No sharing ... copy to the new page.
 	 */
-	memcpy((void *) new_page, (void *) old_page, PAGE_SIZE);
+	copy_page(new_page, old_page);
 	flush_page_to_ram(new_page);
 	release_page(page);
 	return new_page;
diff -urN linux-2.0.39/mm/memory.c linux-2.0.39-patch/mm/memory.c
--- linux-2.0.39/mm/memory.c	Wed Sep 11 11:57:19 1996
+++ linux-2.0.39-patch/mm/memory.c	Sun Oct 13 13:19:20 2002
@@ -57,18 +57,18 @@
  * a common occurrence (no need to read the page to know
  * that it's zero - better for the cache and memory subsystem).
  */
-static inline void copy_page(unsigned long from, unsigned long to)
+static inline void copy_cow_page(unsigned long from, unsigned long to)
 {
-	if (from == ZERO_PAGE) {
-		memset((void *) to, 0, PAGE_SIZE);
+	if (from == ZERO_PAGE(to)) {
+		clear_page(to);
 		return;
 	}
-	memcpy((void *) to, (void *) from, PAGE_SIZE);
+	copy_page(to,from);
 }
 
 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
 
-mem_map_t * mem_map = NULL;
+mem_map_t *mem_map = NULL;
 
 /*
  * oom() prints a message (so that the user knows why the process died),
@@ -88,7 +88,7 @@
  */
 static inline void free_one_pmd(pmd_t * dir)
 {
-	pte_t * pte;
+	pte_t *pte;
 
 	if (pmd_none(*dir))
 		return;
@@ -632,7 +632,7 @@
 		if (new_page) {
 			if (PageReserved(mem_map + MAP_NR(old_page)))
 				++vma->vm_mm->rss;
-			copy_page(old_page,new_page);
+			copy_cow_page(old_page, new_page);
 			flush_page_to_ram(old_page);
 			flush_page_to_ram(new_page);
 			flush_cache_page(vma, address);
@@ -930,7 +930,7 @@
 		unsigned long page = __get_free_page(GFP_KERNEL);
 		if (!page)
 			goto sigbus;
-		memset((void *) page, 0, PAGE_SIZE);
+		clear_page(page);
 		entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
 		vma->vm_mm->rss++;
 		tsk->min_flt++;
diff -urN linux-2.0.39/mm/page_alloc.c linux-2.0.39-patch/mm/page_alloc.c
--- linux-2.0.39/mm/page_alloc.c	Mon Jul 13 17:47:40 1998
+++ linux-2.0.39-patch/mm/page_alloc.c	Tue Oct 15 12:34:58 2002
@@ -42,7 +42,7 @@
 struct free_area_struct {
 	struct page *next;
 	struct page *prev;
-	unsigned int * map;
+	unsigned int *map;
 };
 
 #define memory_head(x) ((struct page *)(x))
diff -urN linux-2.0.39/mm/vmalloc.c linux-2.0.39-patch/mm/vmalloc.c
--- linux-2.0.39/mm/vmalloc.c	Wed Jun  3 19:17:50 1998
+++ linux-2.0.39-patch/mm/vmalloc.c	Tue Oct 15 12:52:09 2002
@@ -97,11 +97,12 @@
 static void free_area_pages(unsigned long address, unsigned long size)
 {
 	pgd_t * dir;
+	unsigned long start = address;
 	unsigned long end = address + size;
 
 	dir = pgd_offset(&init_mm, address);
 	flush_cache_all();
-	while (address < end) {
+	while (address >= start && address < end) {
 		free_area_pmd(dir, address, end - address);
 		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 		dir++;
@@ -154,11 +155,12 @@
 static int alloc_area_pages(unsigned long address, unsigned long size)
 {
 	pgd_t * dir;
+	unsigned long start = address;
 	unsigned long end = address + size;
 
 	dir = pgd_offset(&init_mm, address);
 	flush_cache_all();
-	while (address < end) {
+	while (address >= start && address < end) {
 		pmd_t *pmd = pmd_alloc_kernel(dir, address);
 		if (!pmd)
 			return -ENOMEM;
@@ -250,7 +252,7 @@
 			break;
 		addr = (void *) (tmp->size + (unsigned long) tmp->addr);
 	}
-	area->addr = addr;
+	area->addr = (void *)addr;
 	area->next = *p;
 	*p = area;
 	return area;
diff -urN linux-2.0.39/mm/vmscan.c linux-2.0.39-patch/mm/vmscan.c
--- linux-2.0.39/mm/vmscan.c	Sun Nov 15 16:33:20 1998
+++ linux-2.0.39-patch/mm/vmscan.c	Tue Oct 15 12:21:40 2002
@@ -461,7 +461,7 @@
 	
 	current->session = 1;
 	current->pgrp = 1;
-	sprintf(current->comm, "kswapd");
+	strcpy(current->comm, "kswapd");
 	current->blocked = ~0UL;
 	
 	/*
diff -urN linux-2.0.39/scripts/lxdialog/menubox.c linux-2.0.39-patch/scripts/lxdialog/menubox.c
--- linux-2.0.39/scripts/lxdialog/menubox.c	Sun Nov 15 16:33:24 1998
+++ linux-2.0.39-patch/scripts/lxdialog/menubox.c	Sun Oct 13 13:30:54 2002
@@ -29,7 +29,7 @@
 static void
 print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey)
 {
-    int i, j;
+    int j;
     char menu_item[menu_width+1];
 
     strncpy(menu_item, item, menu_width);
@@ -40,8 +40,11 @@
     wattrset (win, menubox_attr);
     wmove (win, choice, 0);
 #if OLD_NCURSES
-    for (i = 0; i < menu_width; i++)
-	waddch (win, ' ');
+    {
+    	int i;
+	for (i = 0; i < menu_width; i++)
+		waddch (win, ' ');
+    }
 #else
     wclrtoeol(win);
 #endif
diff -urN linux-2.0.39/scripts/lxdialog/textbox.c linux-2.0.39-patch/scripts/lxdialog/textbox.c
--- linux-2.0.39/scripts/lxdialog/textbox.c	Sun Nov 15 16:33:24 1998
+++ linux-2.0.39-patch/scripts/lxdialog/textbox.c	Sun Oct 13 13:31:23 2002
@@ -451,7 +451,7 @@
 static void
 print_line (WINDOW * win, int row, int width)
 {
-    int i, y, x;
+    int y, x;
     char *line;
 
     line = get_line ();
@@ -463,8 +463,11 @@
     getyx (win, y, x);
     /* Clear 'residue' of previous line */
 #if OLD_NCURSES
-    for (i = 0; i < width - x; i++)
-	waddch (win, ' ');
+    {
+	int i;	    
+    	for (i = 0; i < width - x; i++)
+		waddch (win, ' ');
+    }
 #else
     wclrtoeol(win);
 #endif

  parent reply	other threads:[~2002-10-15 19:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1034548634.543.1.camel@nitrogenium>
     [not found] ` <20021014220527.GU26715@khan.acc.umu.se>
2002-10-15 15:37   ` [PATCH 2.0] Fixed kernel stuff Fernando Alencar Maróstica
2002-10-15 19:02   ` Fernando Alencar Maróstica [this message]
2002-10-15 21:11     ` David Weinehall
2002-10-21 19:49       ` Fernando Alencar Maróstica

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1034708558.427.0.camel@nitrogenium \
    --to=famarost@unimep.br \
    --cc=fadel@ferasoft.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tao@acc.umu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.