Skip to contentSkip to conversation

Remove trailing spaces

PATCH In review Cyrill Gorcunov 4 participants 8 messages Nov 12, 2007 – Nov 13, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove trailing spaces

This patch does remove trailing spaces from
source files.

---
 arch/x86/ia32/fpu32.c              |   46 ++++++------
 arch/x86/ia32/ia32_aout.c          |   38 +++++-----
 arch/x86/ia32/ia32_binfmt.c        |    2 +-
 arch/x86/ia32/ia32_signal.c        |  132 ++++++++++++++++++------------------
 arch/x86/ia32/ia32entry.S          |  100 ++++++++++++++--------------
 arch/x86/ia32/ptrace32.c           |  122 +++++++++++++++++-----------------
 arch/x86/ia32/sys_ia32.c           |   98 +++++++++++++-------------
 arch/x86/ia32/syscall32.c          |   16 ++--
 arch/x86/ia32/tls32.c              |   18 +++---
 arch/x86/ia32/vsyscall-sigreturn.S |    4 +-
 arch/x86/ia32/vsyscall.lds         |    4 +-
 11 files changed, 290 insertions(+), 290 deletions(-)
arch/x86/ia32/fpu32.c +23 -23
index 2c8209a..7ab8969 100644
@@ -1,8 +1,8 @@
-/* 
+/*
  * Copyright 2002 Andi Kleen, SuSE Labs.
  * FXSAVE<->i387 conversion support. Based on code by Gareth Hughes.
  * This is used for ptrace, signals and coredumps in 32bit emulation.
- */ 
+ */
 
 #include <linux/sched.h>
 #include <asm/sigcontext32.h>
@@ -13,7 +13,7 @@
 static inline unsigned short twd_i387_to_fxsr(unsigned short twd)
 {
 	unsigned int tmp; /* to avoid 16 bit prefixes in the code */
- 
+
 	/* Transform each pair of bits into 01 (valid) or 00 (empty) */
         tmp = ~twd;
         tmp = (tmp | (tmp>>1)) & 0x5555; /* 0V0V0V0V0V0V0V0V */
@@ -91,8 +91,8 @@ static inline int convert_fxsr_from_user(struct i387_fxsave_struct *fxsave,
 	G(5, fxsave->rdp);
 	/* 6: ds ignored */
 #undef G
-	if (err) 
-		return -1; 
+	if (err)
+		return -1;
 
 	to = (struct _fpxreg *)&fxsave->st_space[0];
 	from = &buf->_st[0];
@@ -112,31 +112,31 @@ static inline int convert_fxsr_to_user(struct _fpstate_ia32 __user *buf,
 	struct _fpreg __user *to;
 	struct _fpxreg *from;
 	int i;
-	u16 cs,ds; 
-	int err = 0; 
+	u16 cs,ds;
+	int err = 0;
 
 	if (tsk == current) {
 		/* should be actually ds/cs at fpu exception time,
 		   but that information is not available in 64bit mode. */
-		asm("movw %%ds,%0 " : "=r" (ds)); 
-		asm("movw %%cs,%0 " : "=r" (cs)); 		
+		asm("movw %%ds,%0 " : "=r" (ds));
+		asm("movw %%cs,%0 " : "=r" (cs));
 	} else { /* ptrace. task has stopped. */
 		ds = tsk->thread.ds;
 		cs = regs->cs;
-	} 
+	}
 
 #define P(num,val) err |= __put_user(val, num + (u32 __user *)buf)
 	P(0, (u32)fxsave->cwd | 0xffff0000);
 	P(1, (u32)fxsave->swd | 0xffff0000);
 	P(2, twd_fxsr_to_i387(fxsave));
 	P(3, (u32)fxsave->rip);
-	P(4,  cs | ((u32)fxsave->fop) << 16); 
+	P(4,  cs | ((u32)fxsave->fop) << 16);
 	P(5, fxsave->rdp);
 	P(6, 0xffff0000 | ds);
 #undef P
 
-	if (err) 
-		return -1; 
+	if (err)
+		return -1;
 
 	to = &buf->_st[0];
 	from = (struct _fpxreg *) &fxsave->st_space[0];
@@ -147,22 +147,22 @@ static inline int convert_fxsr_to_user(struct _fpstate_ia32 __user *buf,
 	return 0;
 }
 
-int restore_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 __user *buf, int fsave) 
-{ 
+int restore_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 __user *buf, int fsave)
+{
 	clear_fpu(tsk);
-	if (!fsave) { 
-		if (__copy_from_user(&tsk->thread.i387.fxsave, 
+	if (!fsave) {
+		if (__copy_from_user(&tsk->thread.i387.fxsave,
 				     &buf->_fxsr_env[0],
 				     sizeof(struct i387_fxsave_struct)))
 			return -1;
 		tsk->thread.i387.fxsave.mxcsr &= mxcsr_feature_mask;
 		set_stopped_child_used_math(tsk);
-	} 
+	}
 	return convert_fxsr_from_user(&tsk->thread.i387.fxsave, buf);
-}  
+}
 
-int save_i387_ia32(struct task_struct *tsk, 
-		   struct _fpstate_ia32 __user *buf, 
+int save_i387_ia32(struct task_struct *tsk,
+		   struct _fpstate_ia32 __user *buf,
 		   struct pt_regs *regs,
 		   int fsave)
 {
@@ -174,8 +174,8 @@ int save_i387_ia32(struct task_struct *tsk,
 	if (fsave)
 		return 0;
 	err |= __put_user(tsk->thread.i387.fxsave.swd, &buf->status);
-	if (fsave) 
-		return err ? -1 : 1; 	
+	if (fsave)
+		return err ? -1 : 1;
 	err |= __put_user(X86_FXSR_MAGIC, &buf->magic);
 	err |= __copy_to_user(&buf->_fxsr_env[0], &tsk->thread.i387.fxsave,
 			      sizeof(struct i387_fxsave_struct));
arch/x86/ia32/ia32_aout.c +19 -19
index f82e1a9..a7e0ac5 100644
@@ -57,14 +57,14 @@ static void dump_thread32(struct pt_regs * regs, struct user32 * dump)
 	dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
 	dump->u_dsize -= dump->u_tsize;
 	dump->u_ssize = 0;
-	dump->u_debugreg[0] = current->thread.debugreg0;  
-	dump->u_debugreg[1] = current->thread.debugreg1;  
-	dump->u_debugreg[2] = current->thread.debugreg2;  
-	dump->u_debugreg[3] = current->thread.debugreg3;  
-	dump->u_debugreg[4] = 0;  
-	dump->u_debugreg[5] = 0;  
-	dump->u_debugreg[6] = current->thread.debugreg6;  
-	dump->u_debugreg[7] = current->thread.debugreg7;  
+	dump->u_debugreg[0] = current->thread.debugreg0;
+	dump->u_debugreg[1] = current->thread.debugreg1;
+	dump->u_debugreg[2] = current->thread.debugreg2;
+	dump->u_debugreg[3] = current->thread.debugreg3;
+	dump->u_debugreg[4] = 0;
+	dump->u_debugreg[5] = 0;
+	dump->u_debugreg[6] = current->thread.debugreg6;
+	dump->u_debugreg[7] = current->thread.debugreg7;
 
 	if (dump->start_stack < 0xc0000000)
 		dump->u_ssize = ((unsigned long) (0xc0000000 - dump->start_stack)) >> PAGE_SHIFT;
@@ -79,7 +79,7 @@ static void dump_thread32(struct pt_regs * regs, struct user32 * dump)
 	dump->regs.ds = current->thread.ds;
 	dump->regs.es = current->thread.es;
 	asm("movl %%fs,%0" : "=r" (fs)); dump->regs.fs = fs;
-	asm("movl %%gs,%0" : "=r" (gs)); dump->regs.gs = gs; 
+	asm("movl %%gs,%0" : "=r" (gs)); dump->regs.gs = gs;
 	dump->regs.orig_eax = regs->orig_rax;
 	dump->regs.eip = regs->rip;
 	dump->regs.cs = regs->cs;
@@ -291,13 +291,13 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 	if (retval)
 		return retval;
 
-	regs->cs = __USER32_CS; 
+	regs->cs = __USER32_CS;
 	regs->r8 = regs->r9 = regs->r10 = regs->r11 = regs->r12 =
 		regs->r13 = regs->r14 = regs->r15 = 0;
 
 	/* OK, This is the point of no return */
 	set_personality(PER_LINUX);
-	set_thread_flag(TIF_IA32); 
+	set_thread_flag(TIF_IA32);
 	clear_thread_flag(TIF_ABI_PENDING);
 
 	current->mm->end_code = ex.a_text +
@@ -338,7 +338,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 			send_sig(SIGKILL, current, 0);
 			return error;
 		}
-			 
+
 		flush_icache_range(text_addr, text_addr+ex.a_text+ex.a_data);
 	} else {
 #ifdef WARN_OLD
@@ -353,7 +353,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 		if ((fd_offset & ~PAGE_MASK) != 0 &&
 		    (jiffies-error_time) > 5*HZ)
 		{
-			printk(KERN_WARNING 
+			printk(KERN_WARNING
 			       "fd_offset is not page aligned. Please convert program: %s\n",
 			       bprm->file->f_path.dentry->d_name.name);
 			error_time = jiffies;
@@ -403,9 +403,9 @@ beyond_if:
 	set_brk(current->mm->start_brk, current->mm->brk);
 
 	retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT);
-	if (retval < 0) { 
-		/* Someone check-me: is this error path enough? */ 
-		send_sig(SIGKILL, current, 0); 
+	if (retval < 0) {
+		/* Someone check-me: is this error path enough? */
+		send_sig(SIGKILL, current, 0);
 		return retval;
 	}
 
@@ -414,7 +414,7 @@ beyond_if:
 	/* start thread */
 	asm volatile("movl %0,%%fs" :: "r" (0)); \
 	asm volatile("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS));
-	load_gs_index(0); 
+	load_gs_index(0);
 	(regs)->rip = ex.a_entry;
 	(regs)->rsp = current->mm->start_stack;
 	(regs)->eflags = 0x200;
@@ -469,7 +469,7 @@ static int load_aout_library(struct file *file)
 		static unsigned long error_time;
 		if ((jiffies-error_time) > 5*HZ)
 		{
-			printk(KERN_WARNING 
+			printk(KERN_WARNING
 			       "N_TXTOFF is not page aligned. Please convert library: %s\n",
 			       file->f_path.dentry->d_name.name);
 			error_time = jiffies;
@@ -478,7 +478,7 @@ static int load_aout_library(struct file *file)
 		down_write(&current->mm->mmap_sem);
 		do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
 		up_write(&current->mm->mmap_sem);
-		
+
 		file->f_op->read(file, (char __user *)start_addr,
 			ex.a_text + ex.a_data, &pos);
 		flush_icache_range((unsigned long) start_addr,
arch/x86/ia32/ia32_binfmt.c +1 -1
index 55822d2..a628aa2 100644
@@ -277,7 +277,7 @@ static ctl_table abi_root_table2[] = {
 };
 
 static __init int ia32_binfmt_init(void)
-{ 
+{
 	register_sysctl_table(abi_root_table2);
 	return 0;
 }
arch/x86/ia32/ia32_signal.c +66 -66

272 lines not on this page · raw message

arch/x86/ia32/ia32entry.S +50 -50

284 lines not on this page · raw message

arch/x86/ia32/ptrace32.c +61 -61

273 lines not on this page · raw message

arch/x86/ia32/sys_ia32.c +49 -49

277 lines not on this page · raw message

arch/x86/ia32/syscall32.c +8 -8
index 15013ba..6df8ec7 100644
@@ -1,6 +1,6 @@
 /* Copyright 2002,2003 Andi Kleen, SuSE Labs */
 
-/* vsyscall handling for 32bit processes. Map a stub page into it 
+/* vsyscall handling for 32bit processes. Map a stub page into it
    on demand because 32bit cannot reach the kernel's fixmaps */
 
 #include <linux/mm.h>
@@ -50,10 +50,10 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
 }
 
 static int __init init_syscall32(void)
-{ 
+{
 	char *syscall32_page = (void *)get_zeroed_page(GFP_KERNEL);
-	if (!syscall32_page) 
-		panic("Cannot allocate syscall32 page"); 
+	if (!syscall32_page)
+		panic("Cannot allocate syscall32 page");
 	syscall32_pages[0] = virt_to_page(syscall32_page);
  	if (use_sysenter > 0) {
  		memcpy(syscall32_page, syscall32_sysenter,
@@ -61,11 +61,11 @@ static int __init init_syscall32(void)
  	} else {
   		memcpy(syscall32_page, syscall32_syscall,
   		       syscall32_syscall_end - syscall32_syscall);
-  	}	
+  	}
 	return 0;
-} 
-	
-__initcall(init_syscall32); 
+}
+
+__initcall(init_syscall32);
 
 /* May not be __init: called during resume */
 void syscall32_cpu_init(void)
arch/x86/ia32/tls32.c +9 -9
index 1cc4340..54a6047 100644
@@ -26,7 +26,7 @@ static int get_free_idx(void)
 
 /*
  * Set a given TLS descriptor:
- * When you want addresses > 32bit use arch_prctl() 
+ * When you want addresses > 32bit use arch_prctl()
  */
 int do_set_thread_area(struct thread_struct *t, struct user_desc __user *u_info)
 {
@@ -76,9 +76,9 @@ int do_set_thread_area(struct thread_struct *t, struct user_desc __user *u_info)
 }
 
 asmlinkage long sys32_set_thread_area(struct user_desc __user *u_info)
-{ 
-	return do_set_thread_area(&current->thread, u_info); 
-} 
+{
+	return do_set_thread_area(&current->thread, u_info);
+}
 
 
 /*
@@ -93,7 +93,7 @@ asmlinkage long sys32_set_thread_area(struct user_desc __user *u_info)
 #define GET_LIMIT(desc) ( \
 	((desc)->a & 0x0ffff) | \
 	 ((desc)->b & 0xf0000) )
-	
+
 #define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
 #define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
 #define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
@@ -135,7 +135,7 @@ int do_get_thread_area(struct thread_struct *t, struct user_desc __user *u_info)
 asmlinkage long sys32_get_thread_area(struct user_desc __user *u_info)
 {
 	return do_get_thread_area(&current->thread, u_info);
-} 
+}
 
 
 int ia32_child_tls(struct task_struct *p, struct pt_regs *childregs)
@@ -144,17 +144,17 @@ int ia32_child_tls(struct task_struct *p, struct pt_regs *childregs)
 	struct user_desc info;
 	struct user_desc __user *cp;
 	int idx;
-	
+
 	cp = (void __user *)childregs->rsi;
 	if (copy_from_user(&info, cp, sizeof(info)))
 		return -EFAULT;
 	if (LDT_empty(&info))
 		return -EINVAL;
-	
+
 	idx = info.entry_number;
 	if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
 		return -EINVAL;
-	
+
 	desc = (struct n_desc_struct *)(p->thread.tls_array) + idx - GDT_ENTRY_TLS_MIN;
 	desc->a = LDT_entry_a(&info);
 	desc->b = LDT_entry_b(&info);
arch/x86/ia32/vsyscall-sigreturn.S +2 -2
index b383be0..a71a4a4 100644
@@ -68,9 +68,9 @@ __kernel_rt_sigreturn:
 	   be the value of the stack pointer in the caller.  This means
 	   that we must define the CFA of this body of code to be the
 	   saved value of the stack pointer in the sigcontext.  Which
-	   also means that there is no fixed relation to the other 
+	   also means that there is no fixed relation to the other
 	   saved registers, which means that we must use DW_CFA_expression
-	   to compute their addresses.  It also means that when we 
+	   to compute their addresses.  It also means that when we
 	   adjust the stack with the popl, we have to do it all over again.  */
 
 #define do_cfa_expr(offset)						\
arch/x86/ia32/vsyscall.lds +2 -2
index 1dc86ff..d9ba318 100644
@@ -23,7 +23,7 @@ SECTIONS
      space for the dynamic symbol table et al.  If this amount
      is insufficient, ld -shared will barf.  Just increase it here.  */
   . = VSYSCALL_BASE + 0x400;
-  
+
   .text.vsyscall   : { *(.text.vsyscall) } 	:text =0x90909090
 
   /* This is an 32bit object and we cannot easily get the offsets
@@ -36,7 +36,7 @@ SECTIONS
   . = VSYSCALL_BASE + 0x600;
 
   .text.rtsigreturn : { *(.text.rtsigreturn) }   :text =0x90909090
-	
+
   .note		  : { *(.note.*) }		:text :note
   .eh_frame_hdr   : { *(.eh_frame_hdr) }	:text :eh_frame_hdr
   .eh_frame       : { KEEP (*(.eh_frame)) }	:text
#1 lore raw
Quoted 2 lines · On Monday 12 November 2007 19:17:47 Cyrill Gorcunov wrote:

This patch does remove trailing spaces from
source files.

That will just cause a zillion patches to not apply anymore with exactly 0 benefit.

-Andi

#2 lore raw
Quoted 5 lines · On Mon, 12 Nov 2007 22:01:45 +0100 Andi Kleen <[email protected]> wrote:
Quoted 2 lines · On Monday 12 November 2007 19:17:47 Cyrill Gorcunov wrote:

This patch does remove trailing spaces from
source files.

That will just cause a zillion patches to not apply anymore

`patch -l'

Quoted 1 line

with exactly 0 benefit.

s/0/very small/

#3 lore raw
In reply to Andi Kleen

From: Andi Kleen <[email protected]>
Date: Mon, 12 Nov 2007 22:01:45 +0100

Quoted 6 lines · On Monday 12 November 2007 19:17:47 Cyrill Gorcunov wrote:
Quoted 2 lines

This patch does remove trailing spaces from
source files.

That will just cause a zillion patches to not apply anymore with exactly 0 benefit.

You'll survive the x86 merge and you'll survive this patch too.

#4 lore raw
Quoted 4 lines · On Monday 12 November 2007 23:50:49 David Miller wrote:

From: Andi Kleen <[email protected]>
Date: Mon, 12 Nov 2007 22:01:45 +0100

Quoted 1 line · On Monday 12 November 2007 19:17:47 Cyrill Gorcunov wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

This patch does remove trailing spaces from
source files.

That will just cause a zillion patches to not apply anymore with exactly 0 benefit.

You'll survive the x86 merge and you'll survive this patch too.

Sure, it's likely not your time that will be wasted.

Perhaps Lindent the whole tree then and drive everybody crazy if you think such pointless changes are a good idea. I'm sure it will make everything much better.

-Andi (who sees some evidence whitespace turns off some people's basic cost:benefit brain functions)

#5 lore raw

From: Andi Kleen <[email protected]>
Date: Mon, 12 Nov 2007 23:55:54 +0100

Quoted 1 line

Sure, it's likely not your time that will be wasted.

I have to respin in excess of 800 networking patches at a time due to these kinds of things. It's absolutely trivial, whether by hand or using tool options that help you with this kind of task.

Suck it up Andi.

#6 lore raw
Quoted 8 lines · On Monday 12 November 2007 23:59:21 David Miller wrote:

From: Andi Kleen <[email protected]>
Date: Mon, 12 Nov 2007 23:55:54 +0100

Quoted 1 line

Sure, it's likely not your time that will be wasted.

I have to respin in excess of 800 networking patches at a time due to these kinds of things. It's absolutely trivial, whether by hand or using tool options that help you with this kind of task.

Sure, but what benefit did it have?

Could you have done something more useful in the time you needed to write the scripts for that?

Also it's not only my time -- there are a lot of people who have x86 patches. e.g. if 20 people have patches and they need half an hour each to write and test and apply scripts for that we're talking about more than a man-day overall wasted.

Quoted 1 line

Suck it up Andi.

Well it just seems a dumb thing to do and I like to complain about dumb things. Sorry that you are more generous about wasting other people's time.

The end white space tends to disappear over time anyways because it is filtered out on everything new, but bulk changing it on old unchanged code is not a good idea.

-Andi (who will shut up because he's approaching the half hour limit for such silly topics. At least it was only me and you though, not 20 people)

#7 lore raw

The patch is just an addition to second one. So if you dont like it - just drop it, if it do conflict with other patches - just drop it. That simple :) what is the benefit of removing spaces? "try to keep your code clean" i've read somwhere...

Quoted 34 lines · Andi Kleen
Quoted 8 lines · On Monday 12 November 2007 23:59:21 David Miller wrote:

From: Andi Kleen <[email protected]>
Date: Mon, 12 Nov 2007 23:55:54 +0100

Quoted 1 line

Sure, it's likely not your time that will be wasted.

I have to respin in excess of 800 networking patches at a time due to these kinds of things. It's absolutely trivial, whether by hand or using tool options that help you with this kind of task.

Sure, but what benefit did it have?

Could you have done something more useful in the time you needed to write the scripts for that?

Also it's not only my time -- there are a lot of people who have x86 patches. e.g. if 20 people have patches and they need half an hour each to write and test and apply scripts for that we're talking about more than a man-day overall wasted.

Quoted 1 line

Suck it up Andi.

Well it just seems a dumb thing to do and I like to complain about dumb things.
Sorry that you are more generous about wasting other people's time.

The end white space tends to disappear over time anyways because it is filtered out on everything new, but bulk changing it on old unchanged code is not a good idea.

-Andi (who will shut up because he's approaching the half hour limit for such silly topics. At least it was only me and you though, not 20 people)