PATCHES (unused code/vars...) for 2.3.18ac8

Thierry vignaud (tvignaud@mandrakesoft.com)
Fri, 24 Sep 1999 13:35:37 +0200


This is a multi-part message in MIME format.
--------------011A6B87D6969D0C6CECB0C6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Here are 2 patches :
* unreachable_code.diff remove some code that cannot be executed
(because of a previous return or break) and remove duplicated break
* unused.diff remove some unused variables and parameters
* flush_tlb_range.diff do the same for flush_tlb_range. Note that we
should do used these unused paramaters else the "range" in the name is
useless...

I just see that i forgot to fix call to apm_get_info. don't forget it
before applying the patch.
--------------011A6B87D6969D0C6CECB0C6
Content-Type: text/plain; charset=us-ascii;
name="unreachable_code.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="unreachable_code.diff"

--- kernel/sys.c.orig Fri Sep 24 00:40:21 1999
+++ kernel/sys.c Fri Sep 24 00:40:24 1999
@@ -209,7 +209,6 @@
default:
unlock_kernel();
return -EINVAL;
- break;
};
unlock_kernel();
return 0;
--- drivers/block/ide-disk.c.orig Fri Sep 24 00:43:59 1999
+++ drivers/block/ide-disk.c Fri Sep 24 00:44:02 1999
@@ -250,7 +250,6 @@
rq->buffer = rq->bh->b_data;
} else {
panic("%s: buffer list corrupted\n", drive->name);
- break;
}
} else {
rq->buffer += nsect << 9;
--- drivers/sound/soundcard.c.orig Fri Sep 24 00:49:51 1999
+++ drivers/sound/soundcard.c Fri Sep 24 00:49:56 1999
@@ -664,7 +664,6 @@
#ifdef CONFIG_MIDI
case SND_DEV_MIDIN:
return MIDIbuf_ioctl(dev, file, cmd, (caddr_t)arg);
- break;
#endif

}
--- drivers/cdrom/cdrom.c.orig Fri Sep 24 00:51:39 1999
+++ drivers/cdrom/cdrom.c Fri Sep 24 00:51:53 1999
@@ -1555,11 +1555,11 @@
format = 0;
break;
case CDROMREADMODE1:
- blocksize = CD_FRAMESIZE; break;
+ blocksize = CD_FRAMESIZE;
format = 2;
break;
case CDROMREADMODE2:
- blocksize = CD_FRAMESIZE_RAW0; break;
+ blocksize = CD_FRAMESIZE_RAW0;
format = 0;
break;
}
--- arch/i386/kernel/traps.c.orig Fri Sep 24 01:05:26 1999
+++ arch/i386/kernel/traps.c Fri Sep 24 01:05:31 1999
@@ -490,25 +490,6 @@
pte_t * pte;

return;
- /*
- * Allocate a new page in virtual address space,
- * move the IDT into it and write protect this page.
- */
- page = (unsigned long) vmalloc(PAGE_SIZE);
- pgd = pgd_offset(&init_mm, page);
- pmd = pmd_offset(pgd, page);
- pte = pte_offset(pmd, page);
- free_page(pte_page(*pte));
- *pte = mk_pte(&idt_table, PAGE_KERNEL_RO);
- local_flush_tlb();
-
- /*
- * "idt" is magic - it overlaps the idt_descr
- * variable so that updating idt will automatically
- * update the idt descriptor..
- */
- idt = (struct desc_struct *)page;
- __asm__ __volatile__("lidt %0": "=m" (idt_descr));
}

#define _set_gate(gate_addr,type,dpl,addr) \
--- arch/i386/kernel/setup.c.orig Fri Sep 24 01:07:04 1999
+++ arch/i386/kernel/setup.c Fri Sep 24 01:07:07 1999
@@ -881,7 +881,6 @@
dir0_msn = 0;
p = Cx486S_name[0];
break;
- break;
}

default: /* unknown (shouldn't happen, we know everyone ;-) */

--------------011A6B87D6969D0C6CECB0C6
Content-Type: text/plain; charset=us-ascii;
name="unused.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="unused.diff"

--- include/linux/wait.h.orig Fri Sep 24 01:13:28 1999
+++ include/linux/wait.h Fri Sep 24 01:13:33 1999
@@ -186,8 +186,7 @@
list_add(&new->task_list, head->task_list.prev);
}

-extern inline void __remove_wait_queue(wait_queue_head_t *head,
- wait_queue_t *old)
+extern inline void __remove_wait_queue(wait_queue_t *old)
{
#if WAITQUEUE_DEBUG
if (!old)
--- kernel/sched.c.orig Fri Sep 24 01:14:17 1999
+++ kernel/sched.c Fri Sep 24 01:14:20 1999
@@ -822,7 +822,7 @@

#define SLEEP_ON_TAIL \
wq_write_lock_irq(&q->lock); \
- __remove_wait_queue(q, &wait); \
+ __remove_wait_queue(&wait); \
wq_write_unlock_irqrestore(&q->lock,flags);

void interruptible_sleep_on(wait_queue_head_t *q)
--- include/linux/sched.h.orig Fri Sep 24 01:14:54 1999
+++ include/linux/sched.h Fri Sep 24 01:14:56 1999
@@ -724,7 +724,7 @@
unsigned long flags;

wq_write_lock_irqsave(&q->lock, flags);
- __remove_wait_queue(q, wait);
+ __remove_wait_queue(wait);
wq_write_unlock_irqrestore(&q->lock, flags);
}

--- kernel/sched.c2 Fri Sep 24 01:46:41 1999
+++ kernel/sched.c Fri Sep 24 01:46:43 1999
@@ -1662,7 +1662,7 @@
return ret;
}

-asmlinkage long sys_sched_rr_get_interval(pid_t pid, struct timespec *interval)
+asmlinkage long sys_sched_rr_get_interval(struct timespec *interval)
{
struct timespec t;

--- arch/sparc64/kernel/sys_sparc32.c.orig Fri Sep 24 01:49:27 1999
+++ arch/sparc64/kernel/sys_sparc32.c Fri Sep 24 01:49:28 1999
@@ -1531,7 +1531,7 @@
s32 tv_nsec;
};

-extern asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval);
+extern asmlinkage int sys_sched_rr_get_interval(struct timespec *interval);

asmlinkage int sys32_sched_rr_get_interval(__kernel_pid_t32 pid, struct timespec32 *interval)
{
@@ -1540,7 +1540,7 @@
mm_segment_t old_fs = get_fs ();

set_fs (KERNEL_DS);
- ret = sys_sched_rr_get_interval(pid, &t);
+ ret = sys_sched_rr_get_interval(&t);
set_fs (old_fs);
if (put_user (t.tv_sec, &interval->tv_sec) ||
__put_user (t.tv_nsec, &interval->tv_nsec))
--- drivers/net/8390.c.orig Fri Sep 24 01:59:17 1999
+++ drivers/net/8390.c Fri Sep 24 01:59:19 1999
@@ -149,7 +149,6 @@
int ei_open(struct net_device *dev)
{
unsigned long flags;
- struct ei_device *ei_local = (struct ei_device *) dev->priv;

/* This can't happen unless somebody forgot to call ethdev_init(). */
if (ei_local == NULL)
--- arch/i386/kernel/apm.c.orig Fri Sep 24 01:58:11 1999
+++ arch/i386/kernel/apm.c Fri Sep 24 02:01:19 1999
@@ -1257,13 +1257,12 @@
return 0;
}

-int apm_get_info(char *buf, char **start, off_t fpos, int length, int dummy)
+int apm_get_info(char *buf)
{
char * p;
unsigned short bx;
unsigned short cx;
unsigned short dx;
- unsigned short nbat;
unsigned short error;
unsigned short ac_line_status = 0xff;
unsigned short battery_status = 0xff;

--------------011A6B87D6969D0C6CECB0C6
Content-Type: text/plain; charset=us-ascii;
name="flush_tlb_range.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="flush_tlb_range.diff"

--- fs/proc/mem.c.orig Fri Sep 24 01:30:48 1999
+++ fs/proc/mem.c Fri Sep 24 01:30:50 1999
@@ -309,8 +309,8 @@
dtmp += PAGE_SIZE;
}

- flush_tlb_range(vma->vm_mm, vma->vm_start, vma->vm_end);
- flush_tlb_range(src_vma->vm_mm, src_vma->vm_start, src_vma->vm_end);
+ flush_tlb_range(vma->vm_mm);
+ flush_tlb_range(src_vma->vm_mm);
return 0;
}

--- include/asm/pgtable.h.orig Fri Sep 24 01:17:13 1999
+++ include/asm/pgtable.h Fri Sep 24 01:33:30 1999
@@ -34,7 +34,7 @@
* - flush_tlb_all() flushes all processes TLBs
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_range(mm ) flushes a range of pages
*
* ..but the i386 has somewhat limited tlb flushing capabilities,
* and page-granular flushes are available only on i486 and up.
@@ -69,8 +69,7 @@
__flush_tlb_one(addr);
}

-static inline void flush_tlb_range(struct mm_struct *mm,
- unsigned long start, unsigned long end)
+static inline void flush_tlb_range(struct mm_struct *mm)
{
if (mm == current->active_mm)
__flush_tlb();
@@ -95,7 +94,7 @@

#define flush_tlb() flush_tlb_current_task()

-static inline void flush_tlb_range(struct mm_struct * mm, unsigned long start, unsigned long end)
+static inline void flush_tlb_range(struct mm_struct * mm)
{
flush_tlb_mm(mm);
}
--- mm/memory.c.orig Fri Sep 24 01:35:01 1999
+++ mm/memory.c Fri Sep 24 01:34:57 1999
@@ -635,7 +635,7 @@
address = (address + PGDIR_SIZE) & PGDIR_MASK;
dir++;
}
- flush_tlb_range(current->mm, beg, end);
+ flush_tlb_range(current->mm);
return error;
}

@@ -710,7 +710,7 @@
from = (from + PGDIR_SIZE) & PGDIR_MASK;
dir++;
}
- flush_tlb_range(current->mm, beg, end);
+ flush_tlb_range(current->mm);
return error;
}

@@ -909,7 +909,7 @@
if (mpnt->vm_offset >= offset) {
flush_cache_range(mm, start, end);
zap_page_range(mm, start, len);
- flush_tlb_range(mm, start, end);
+ flush_tlb_range(mm);
continue;
}
/* mapping wholly unaffected? */
@@ -925,7 +925,7 @@
}
flush_cache_range(mm, start, end);
zap_page_range(mm, start, len);
- flush_tlb_range(mm, start, end);
+ flush_tlb_range(mm);
} while ((mpnt = mpnt->vm_next_share) != NULL);
out_unlock:
spin_unlock(&inode->i_shared_lock);
--- mm/mmap.c.orig Fri Sep 24 01:35:49 1999
+++ mm/mmap.c Fri Sep 24 01:35:52 1999
@@ -338,7 +338,7 @@
/* Undo any partial mapping done by a device driver. */
flush_cache_range(mm, vma->vm_start, vma->vm_end);
zap_page_range(mm, vma->vm_start, vma->vm_end - vma->vm_start);
- flush_tlb_range(mm, vma->vm_start, vma->vm_end);
+ flush_tlb_range(mm);
free_vma:
kmem_cache_free(vm_area_cachep, vma);
return error;
@@ -689,7 +689,7 @@

flush_cache_range(mm, st, end);
zap_page_range(mm, st, size);
- flush_tlb_range(mm, st, end);
+ flush_tlb_range(mm);

/*
* Fix the mapping, and free the old area if it wasn't reused.
--- mm/mprotect.c.orig Fri Sep 24 01:36:20 1999
+++ mm/mprotect.c Fri Sep 24 01:36:22 1999
@@ -75,7 +75,7 @@
start = (start + PGDIR_SIZE) & PGDIR_MASK;
dir++;
}
- flush_tlb_range(current->mm, beg, end);
+ flush_tlb_range(current->mm);
return;
}

--- mm/filemap.c.orig Fri Sep 24 01:37:28 1999
+++ mm/filemap.c Fri Sep 24 01:37:29 1999
@@ -1598,7 +1598,7 @@
address = (address + PGDIR_SIZE) & PGDIR_MASK;
dir++;
}
- flush_tlb_range(vma->vm_mm, end - size, end);
+ flush_tlb_range(vma->vm_mm);
return error;
}

--- mm/mremap.c.orig Fri Sep 24 01:37:59 1999
+++ mm/mremap.c Fri Sep 24 01:38:01 1999
@@ -93,7 +93,7 @@
unsigned long offset = len;

flush_cache_range(mm, old_addr, old_addr + len);
- flush_tlb_range(mm, old_addr, old_addr + len);
+ flush_tlb_range(mm);

/*
* This is not the clever way to do this, but we're taking the
@@ -119,7 +119,7 @@
while ((offset += PAGE_SIZE) < len)
move_one_page(mm, new_addr + offset, old_addr + offset);
zap_page_range(mm, new_addr, len);
- flush_tlb_range(mm, new_addr, new_addr + len);
+ flush_tlb_range(mm);
return -1;
}

--- drivers/char/mem.c.orig Fri Sep 24 01:39:32 1999
+++ drivers/char/mem.c Fri Sep 24 01:39:34 1999
@@ -348,7 +348,7 @@
flush_cache_range(mm, addr, addr + count);
zap_page_range(mm, addr, count);
zeromap_page_range(addr, count, PAGE_COPY);
- flush_tlb_range(mm, addr, addr + count);
+ flush_tlb_range(mm);

size -= count;
buf += count;

--------------011A6B87D6969D0C6CECB0C6--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/