[parisc-linux-cvs] misc changes

Matthew Wilcox willy@ldl.fc.hp.com
Sat, 14 Jul 2001 01:23:50 -0600


sys_parisc32.c:
remove bogus extern from sys32_sysctl.
change oldlen32 to be unsigned.
reformat a little.

binfmt_elf.c:
fix a bogus comment from the 2.4.6 merge.

binfmt_som.c:
remove bogus sti (we're in process context here; how can we possibly
have irq's disabled?!)
change `size' to be unsigned.

exit.c:
add comment to explain one of our changes to future hackers.

Index: arch/parisc/kernel/sys_parisc32.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/sys_parisc32.c,v
retrieving revision 1.21
diff -u -p -r1.21 sys_parisc32.c
--- sys_parisc32.c	2001/07/06 03:44:50	1.21
+++ sys_parisc32.c	2001/07/14 06:38:47
@@ -471,11 +471,11 @@ struct __sysctl_args32 {
 	u32 __unused[4];
 };
 
-extern asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
+asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
 {
 	struct __sysctl_args32 tmp;
 	int error;
-	int oldlen32;
+	unsigned int oldlen32;
 	size_t oldlen, *oldlenp = NULL;
 	unsigned long addr = (((long)&args->__unused[0]) + 7) & ~7;
 	extern int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
@@ -499,12 +499,10 @@ extern asmlinkage long sys32_sysctl(stru
 		 */
 		if (get_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
 			return -EFAULT;
-		else {
-		    oldlen = oldlen32;
-		    if (put_user(oldlen, (size_t *)addr))
-			    return -EFAULT;
-		    oldlenp = (size_t *)addr;
-		}
+		oldlen = oldlen32;
+		if (put_user(oldlen, (size_t *)addr))
+			return -EFAULT;
+		oldlenp = (size_t *)addr;
 	}
 
 	lock_kernel();
@@ -513,12 +511,12 @@ extern asmlinkage long sys32_sysctl(stru
 	unlock_kernel();
 	if (oldlenp) {
 		if (!error) {
-			if (get_user(oldlen, (size_t *)addr))
+			if (get_user(oldlen, (size_t *)addr)) {
 				error = -EFAULT;
-			else {
-			    oldlen32 = oldlen;
-			    if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
-				    error = -EFAULT;
+			} else {
+				oldlen32 = oldlen;
+				if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
+					error = -EFAULT;
 			}
 		}
 		if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
Index: fs/binfmt_elf.c
===================================================================
RCS file: /home/cvs/parisc/linux/fs/binfmt_elf.c,v
retrieving revision 1.18
diff -u -p -r1.18 binfmt_elf.c
--- binfmt_elf.c	2001/07/05 23:09:05	1.18
+++ binfmt_elf.c	2001/07/14 06:38:48
@@ -218,9 +218,7 @@ create_elf_tables(struct linux_binprm *b
 	__put_user(NULL, envp);
 	current->mm->env_end = p;
 
-	/* Put the elf_info on the stack in the right place.
-	 * PowerPC had it put on the stack earlier.  See above.
-	 */
+	/* Put the elf_info on the stack in the right place.  */
 	sp = (elf_addr_t *)envp + 1;
 	copy_to_user(sp, elf_info, ei_index * sizeof(elf_addr_t)); 
 }
Index: fs/binfmt_som.c
===================================================================
RCS file: /home/cvs/parisc/linux/fs/binfmt_som.c,v
retrieving revision 1.17
diff -u -p -r1.17 binfmt_som.c
--- binfmt_som.c	2001/07/06 03:52:15	1.17
+++ binfmt_som.c	2001/07/14 06:38:48
@@ -186,12 +186,11 @@ static inline int
 do_load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 {
 	int som_exec_fileno;
-	int retval, size;
+	int retval;
+	unsigned int size;
 	unsigned long som_entry;
 	struct som_hdr *som_ex;
 	struct som_exec_auxhdr *hpuxhdr;
-
-	sti();
 
 	/* Get the exec-header */
 	som_ex = (struct som_hdr *) bprm->buf;
Index: kernel/exit.c
===================================================================
RCS file: /home/cvs/parisc/linux/kernel/exit.c,v
retrieving revision 1.10
diff -u -p -r1.10 exit.c
--- exit.c	2001/07/05 21:39:48	1.10
+++ exit.c	2001/07/14 06:38:49
@@ -175,6 +175,9 @@ static inline void forget_original_paren
 	read_unlock(&tasklist_lock);
 }
 
+/* Our only caller guarantees that files->count is zero and will not be
+ * incremented, so there is no danger of races.
+ */
 static inline void close_files(struct files_struct * files)
 {
 	int i, j;