Resent-Date: Fri, 13 Aug 1999 11:30:53 +0200 (MET DST)
To: linux-m68k@lists.linux-m68k.org
Subject: Re: 2.3.13 is out
References: <199908121603.SAA05938@lxp03.cern.ch>
X-Yow: FOOLED you!  Absorb EGO SHATTERING impulse rays, polyester poltroon!!
From: Andreas Schwab <schwab@suse.de>
Date: 13 Aug 1999 11:30:43 +0200
In-Reply-To: Jes Sorensen's message of "Thu, 12 Aug 1999 18:03:04 +0200"
User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) Emacs/20.4
Resent-From: linux-m68k@phil.uni-sb.de

Hi!

Here are some patches for 2.3.13 that I found just by compiling the
kernel.  Please note that I could not test it yet!

Andreas.


diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/arch/m68k/kernel/Makefile linux/arch/m68k/kernel/Makefile
--- linux-2.3.13/arch/m68k/kernel/Makefile	Mon Dec  7 15:20:16 1998
+++ linux/arch/m68k/kernel/Makefile	Thu Aug 12 19:00:41 1999
@@ -13,8 +13,8 @@
 all: head.o kernel.o
 O_TARGET := kernel.o
 O_OBJS := entry.o process.o traps.o ints.o signal.o ptrace.o \
-	  setup.o sys_m68k.o time.o
-OX_OBJS := m68k_ksyms.o
+	  sys_m68k.o time.o
+OX_OBJS := setup.o m68k_ksyms.o
 
 ifdef CONFIG_KGDB
 O_OBJS += kgdb.o
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/arch/m68k/kernel/setup.c linux/arch/m68k/kernel/setup.c
--- linux-2.3.13/arch/m68k/kernel/setup.c	Thu Aug  5 15:40:25 1999
+++ linux/arch/m68k/kernel/setup.c	Thu Aug 12 19:47:06 1999
@@ -19,6 +19,7 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/module.h>
 
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
@@ -452,6 +453,9 @@
   m68k_unregister_serial(i);
 #endif
 }
+EXPORT_SYMBOL(register_serial);
+EXPORT_SYMBOL(unregister_serial);
+
 #ifdef CONFIG_SERIAL_CONSOLE
 long serial_console_init(long kmem_start, long kmem_end)
 {
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/arch/m68k/mm/memory.c linux/arch/m68k/mm/memory.c
--- linux-2.3.13/arch/m68k/mm/memory.c	Thu Aug  5 15:40:26 1999
+++ linux/arch/m68k/mm/memory.c	Fri Aug 13 10:28:42 1999
@@ -385,7 +385,7 @@
 }
 
 #ifndef CONFIG_SINGLE_MEMORY_CHUNK
-void *mm_ptov (unsigned long paddr)
+unsigned long mm_ptov (unsigned long paddr)
 {
 	int i = 0;
 	unsigned long poff, voff = PAGE_OFFSET;
@@ -396,7 +396,7 @@
 #ifdef DEBUGPV
 			printk ("PTOV(%lx)=%lx\n", paddr, poff + voff);
 #endif
-			return (void *)(poff + voff);
+			return poff + voff;
 		}
 		voff += m68k_memory[i].size;
 	} while (++i < m68k_num_memory);
@@ -429,9 +429,9 @@
 	 * to the ZTWO_VADDR range
 	 */
 	if (MACH_IS_AMIGA && paddr < 16*1024*1024)
-		return (void *)ZTWO_VADDR(paddr);
+		return ZTWO_VADDR(paddr);
 #endif
-	return (void *)-1;
+	return -1;
 }
 #endif
 
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/drivers/block/Makefile linux/drivers/block/Makefile
--- linux-2.3.13/drivers/block/Makefile	Fri Aug  6 18:43:08 1999
+++ linux/drivers/block/Makefile	Fri Aug 13 10:21:35 1999
@@ -20,10 +20,10 @@
 
 
 L_TARGET := block.a
-L_OBJS   := genhd.o
+L_OBJS   :=
 M_OBJS   :=
 MOD_LIST_NAME := BLOCK_MODULES
-LX_OBJS := ll_rw_blk.o blkpg.o
+LX_OBJS := genhd.o ll_rw_blk.o blkpg.o
 MX_OBJS :=
 
 ifeq ($(CONFIG_MSDOS_PARTITION),y)
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/drivers/block/partbl_atari.c linux/drivers/block/partbl_atari.c
--- linux-2.3.13/drivers/block/partbl_atari.c	Thu Aug  5 10:45:22 1999
+++ linux/drivers/block/partbl_atari.c	Fri Aug 13 10:23:29 1999
@@ -43,7 +43,6 @@
   u32 extensect;
   u32 hd_size;
   unsigned int psum;
-  int i;
 #ifdef ICD_PARTS
   int part_fmt = 0; /* 0:unknown, 1:AHDI, 2:ICD/Supra */
 #endif
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/drivers/char/Makefile linux/drivers/char/Makefile
--- linux-2.3.13/drivers/char/Makefile	Fri Aug  6 18:43:25 1999
+++ linux/drivers/char/Makefile	Thu Aug 12 19:28:10 1999
@@ -308,7 +308,7 @@
 endif
 
 ifeq ($(CONFIG_SX),y)
-L_OBJS += sx.o generic_serial.o
+O_OBJS += sx.o generic_serial.o
 else
   ifeq ($(CONFIG_SX),m)
   M_OBJS += sx.o
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/drivers/char/atarimouse.c linux/drivers/char/atarimouse.c
--- linux-2.3.13/drivers/char/atarimouse.c	Fri Aug  6 16:55:42 1999
+++ linux/drivers/char/atarimouse.c	Thu Aug 12 19:16:19 1999
@@ -43,12 +43,12 @@
 
 /*    ikbd_mouse_disable(); */
 
-    buttons = ((buf[0] & 1 ? 1 : 0)
-	       | (buf[0] & 2 ? 4 : 0)
+    buttons = ((buf[0] & 1)
+	       | ((buf[0] & 2) << 1)
 	       | (atari_mouse_buttons & 2));
     atari_mouse_buttons = buttons;
 
-    busmouse_add_movementbuttons(msedev, buf[1], -buf[2], buttons);
+    busmouse_add_movementbuttons(msedev, buf[1], -buf[2], buttons ^ 7);
 /*    ikbd_mouse_rel_pos(); */
 }
 
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/drivers/char/mem.c linux/drivers/char/mem.c
--- linux-2.3.13/drivers/char/mem.c	Tue Aug 10 12:34:53 1999
+++ linux/drivers/char/mem.c	Fri Aug 13 10:23:56 1999
@@ -462,10 +462,12 @@
 	}
 }
 
+#if !defined(CONFIG_PPC) && !defined(__mc68000__)
 static int open_port(struct inode * inode, struct file * filp)
 {
 	return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
 }
+#endif
 
 static int open_mem(struct inode * inode, struct file * filp)
 {
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/fs/minix/fsync.c linux/fs/minix/fsync.c
--- linux-2.3.13/fs/minix/fsync.c	Wed Aug  4 20:44:20 1999
+++ linux/fs/minix/fsync.c	Thu Aug 12 19:02:37 1999
@@ -28,7 +28,7 @@
 /*
  * The functions for minix V1 fs file synchronization.
  */
-static int V1_sync_block (struct inode * inode, unsigned short * block, int wait)
+static int V1_sync_indirect (struct inode * inode, unsigned short * block, int wait)
 {
 	struct buffer_head * bh;
 	unsigned short tmp;
@@ -67,59 +67,15 @@
 	tmp = *iblock;
 	if (!tmp)
 		return 0;
-	rc = V1_sync_block (inode, iblock, wait);
+	rc = V1_sync_indirect (inode, iblock, wait);
 	if (rc)
 		return rc;
 	*bh = bread(inode->i_dev, tmp, blocksize);
-	if (tmp != *iblock) {
-		brelse(*bh);
-		*bh = NULL;
-		return 1;
-	}
 	if (!*bh)
 		return -1;
 	return 0;
 }
 
-static int V1_sync_direct(struct inode *inode, int wait)
-{
-	int i;
-	int rc, err = 0;
-
-	for (i = 0; i < 7; i++) {
-		rc = V1_sync_block (inode, 
-		     (unsigned short *) inode->u.minix_i.u.i1_data + i, wait);
-		if (rc > 0)
-			break;
-		if (rc)
-			err = rc;
-	}
-	return err;
-}
-
-static int V1_sync_indirect(struct inode *inode, unsigned short *iblock, int wait)
-{
-	int i;
-	struct buffer_head * ind_bh;
-	int rc, err = 0;
-
-	rc = V1_sync_iblock (inode, iblock, &ind_bh, wait);
-	if (rc || !ind_bh)
-		return rc;
-
-	for (i = 0; i < 512; i++) {
-		rc = V1_sync_block (inode, 
-				    ((unsigned short *) ind_bh->b_data) + i, 
-				    wait);
-		if (rc > 0)
-			break;
-		if (rc)
-			err = rc;
-	}
-	brelse(ind_bh);
-	return err;
-}
-
 static int V1_sync_dindirect(struct inode *inode, unsigned short *diblock,
 			  int wait)
 {
@@ -135,8 +91,6 @@
 		rc = V1_sync_indirect (inode,
 				       ((unsigned short *) dind_bh->b_data) + i, 
 				       wait);
-		if (rc > 0)
-			break;
 		if (rc)
 			err = rc;
 	}
@@ -148,24 +102,21 @@
 {
 	int wait, err = 0;
 	
-	if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
-	     S_ISLNK(inode->i_mode)))
-		return -EINVAL;
+	err = generic_buffer_fdatasync(inode, 0, ~0UL);
 
 	for (wait=0; wait<=1; wait++)
 	{
-		err |= V1_sync_direct(inode, wait);
 		err |= V1_sync_indirect(inode, inode->u.minix_i.u.i1_data + 7, wait);
 		err |= V1_sync_dindirect(inode, inode->u.minix_i.u.i1_data + 8, wait);
 	}
 	err |= minix_sync_inode (inode);
-	return (err < 0) ? -EIO : 0;
+	return err ? -EIO : 0;
 }
 
 /* 
  * The functions for minix V2 fs file synchronization.
  */
-static int V2_sync_block (struct inode * inode, unsigned long * block, int wait)
+static int V2_sync_indirect (struct inode * inode, unsigned long * block, int wait)
 {
 	struct buffer_head * bh;
 	unsigned long tmp;
@@ -176,10 +127,6 @@
 	bh = get_hash_table(inode->i_dev, *block, blocksize);
 	if (!bh)
 		return 0;
-	if (*block != tmp) {
-		brelse (bh);
-		return 1;
-	}
 	if (wait && buffer_req(bh) && !buffer_uptodate(bh)) {
 		brelse(bh);
 		return -1;
@@ -204,59 +151,15 @@
 	tmp = *iblock;
 	if (!tmp)
 		return 0;
-	rc = V2_sync_block (inode, iblock, wait);
+	rc = V2_sync_indirect (inode, iblock, wait);
 	if (rc)
 		return rc;
 	*bh = bread(inode->i_dev, tmp, blocksize);
-	if (tmp != *iblock) {
-		brelse(*bh);
-		*bh = NULL;
-		return 1;
-	}
 	if (!*bh)
 		return -1;
 	return 0;
 }
 
-static int V2_sync_direct(struct inode *inode, int wait)
-{
-	int i;
-	int rc, err = 0;
-
-	for (i = 0; i < 7; i++) {
-		rc = V2_sync_block (inode, 
-			(unsigned long *)inode->u.minix_i.u.i2_data + i, wait);
-		if (rc > 0)
-			break;
-		if (rc)
-			err = rc;
-	}
-	return err;
-}
-
-static int V2_sync_indirect(struct inode *inode, unsigned long *iblock, int wait)
-{
-	int i;
-	struct buffer_head * ind_bh;
-	int rc, err = 0;
-
-	rc = V2_sync_iblock (inode, iblock, &ind_bh, wait);
-	if (rc || !ind_bh)
-		return rc;
-
-	for (i = 0; i < 256; i++) {
-		rc = V2_sync_block (inode, 
-				    ((unsigned long *) ind_bh->b_data) + i, 
-				    wait);
-		if (rc > 0)
-			break;
-		if (rc)
-			err = rc;
-	}
-	brelse(ind_bh);
-	return err;
-}
-
 static int V2_sync_dindirect(struct inode *inode, unsigned long *diblock,
 			  int wait)
 {
@@ -272,8 +175,6 @@
 		rc = V2_sync_indirect (inode,
 				       ((unsigned long *) dind_bh->b_data) + i, 
 				       wait);
-		if (rc > 0)
-			break;
 		if (rc)
 			err = rc;
 	}
@@ -296,8 +197,6 @@
 		rc = V2_sync_dindirect (inode,
 					((unsigned long *) tind_bh->b_data) + i, 
 					wait);
-		if (rc > 0)
-			break;
 		if (rc)
 			err = rc;
 	}
@@ -308,14 +207,11 @@
 static int V2_minix_sync_file(struct inode * inode, struct file * file)
 {
 	int wait, err = 0;
-	
-	if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
-	     S_ISLNK(inode->i_mode)))
-		return -EINVAL;
+
+	err = generic_buffer_fdatasync(inode, 0, ~0UL);
 
 	for (wait=0; wait<=1; wait++)
 	{
-		err |= V2_sync_direct(inode, wait);
 		err |= V2_sync_indirect(inode, 
 		      (unsigned long *) inode->u.minix_i.u.i2_data + 7, wait);
 		err |= V2_sync_dindirect(inode, 
@@ -324,7 +220,7 @@
 		      (unsigned long *) inode->u.minix_i.u.i2_data + 9, wait);
 	}
 	err |= minix_sync_inode (inode);
-	return (err < 0) ? -EIO : 0;
+	return err ? -EIO : 0;
 }
 
 /*
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/fs/minix/inode.c linux/fs/minix/inode.c
--- linux-2.3.13/fs/minix/inode.c	Wed Aug  4 20:44:20 1999
+++ linux/fs/minix/inode.c	Fri Aug 13 10:26:53 1999
@@ -518,7 +518,7 @@
 		}
 	}
 
-	tmp = minix_new_block(inode->i_sb);
+	tmp = minix_new_block(inode);
 	if (!tmp) {
 		*err = -ENOSPC;
 		return NULL;
@@ -526,7 +526,7 @@
 	if (metadata) {
 		result = getblk(inode->i_dev, tmp, BLOCK_SIZE);
 		if (*p) {
-			minix_free_block(inode->i_sb, tmp);
+			minix_free_block(inode, tmp);
 			brelse(result);
 			goto repeat;
 		}
@@ -540,7 +540,7 @@
 			 * state from under us:
 			 */
 			BUG();
-			minix_free_block(inode->i_sb, tmp);
+			minix_free_block(inode, tmp);
 			goto repeat;
 		}
 		*phys = tmp;
@@ -599,13 +599,13 @@
 		}
 	}
 
-	tmp = minix_new_block(inode->i_sb);
+	tmp = minix_new_block(inode);
 	if (!tmp)
 		goto out;
 	if (metadata) {
 		result = getblk(bh->b_dev, tmp, BLOCK_SIZE);
 		if (*p) {
-			minix_free_block(inode->i_sb, tmp);
+			minix_free_block(inode, tmp);
 			brelse(result);
 			goto repeat;
 		}
@@ -617,7 +617,7 @@
 		*new = 1;
 	}
 	if (*p) {
-		minix_free_block(inode->i_sb, tmp);
+		minix_free_block(inode, tmp);
 		brelse(result);
 		goto repeat;
 	}
@@ -754,7 +754,7 @@
 		}
 	}
 
-	tmp = minix_new_block(inode->i_sb);
+	tmp = minix_new_block(inode);
 	if (!tmp) {
 		*err = -ENOSPC;
 		return NULL;
@@ -762,7 +762,7 @@
 	if (metadata) {
 		result = getblk(inode->i_dev, tmp, BLOCK_SIZE);
 		if (*p) {
-			minix_free_block(inode->i_sb, tmp);
+			minix_free_block(inode, tmp);
 			brelse(result);
 			goto repeat;
 		}
@@ -776,7 +776,7 @@
 			 * state from under us:
 			 */
 			BUG();
-			minix_free_block(inode->i_sb, tmp);
+			minix_free_block(inode, tmp);
 			goto repeat;
 		}
 		*phys = tmp;
@@ -835,13 +835,13 @@
 		}
 	}
 
-	tmp = minix_new_block(inode->i_sb);
+	tmp = minix_new_block(inode);
 	if (!tmp)
 		goto out;
 	if (metadata) {
 		result = getblk(bh->b_dev, tmp, BLOCK_SIZE);
 		if (*p) {
-			minix_free_block(inode->i_sb, tmp);
+			minix_free_block(inode, tmp);
 			brelse(result);
 			goto repeat;
 		}
@@ -853,7 +853,7 @@
 		*new = 1;
 	}
 	if (*p) {
-		minix_free_block(inode->i_sb, tmp);
+		minix_free_block(inode, tmp);
 		brelse(result);
 		goto repeat;
 	}
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/fs/msdos/namei.c linux/fs/msdos/namei.c
--- linux-2.3.13/fs/msdos/namei.c	Tue Aug 10 12:36:28 1999
+++ linux/fs/msdos/namei.c	Fri Aug 13 10:27:17 1999
@@ -361,8 +361,6 @@
 	struct inode *inode;
 	int res,is_hid;
 	char msdos_name[MSDOS_NAME];
-	struct buffer_head *bh1;
-	struct msdos_dir_entry *de1;
 	int ino;
 
 	res = msdos_format_name(dentry->d_name.name,dentry->d_name.len,
diff -ur -xCVS -x.#* -x.*.flags -x*.[oa] -x.depend linux-2.3.13/lib/string.c linux/lib/string.c
--- linux-2.3.13/lib/string.c	Sat Aug  7 14:00:57 1999
+++ linux/lib/string.c	Fri Aug 13 10:27:49 1999
@@ -369,7 +369,7 @@
 	const unsigned char *p = s;
 	while (n-- != 0) {
         	if ((unsigned char)c == *p++) {
-			return p-1;
+			return (void *)(p-1);
 		}
 	}
 	return NULL;

-- 
Andreas Schwab                                  "And now for something
schwab@suse.de                                   completely different."
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

