Skip to contentSkip to conversation

x86: Unneeded assignment to tsk in recent x86 change, v2

PATCH In review Uros Bizjak 2 participants 2 messages Jan 22, 2009 – Jan 23, 2009

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

PATCH 1/1 x86: Unneeded assignment to tsk in recent x86 change, v2

On Wed, Jan 21, 2009 at 10:13 PM, Mikael Pettersson <[email protected]> wrote:

Impact: Cleanup.

Remove unneeded assignment to tsk in recent x86 change.

Quoted 8 lines
Quoted 2 lines

Hm, I'm not sure I see the inconsistency here. Care to explain this inconsistency in a couple of words?

You're initialising some variables in their declarations, and some using assignments at the start of the procedure body. In particular, for some reason you don't initialise 'mm' in its declaration even though you could do so for consistency with 'tsk'.

Quoted 5 lines

However, I'm strongly in favour of separating declarations and initialisations (esp. ones that need actual computations), so rather than subjecting 'mm' to the treatment you gave 'tsk', just leave the code alone.

Patch v2 with the second hunk removed is attached to this message.

Thanks,
Uros.

arch/x86/mm/fault.c +0 -1
index 93a563b..621e9b3 100644
@@ -421,7 +421,6 @@ static noinline void pgtable_bad(struct pt_regs *regs,
 	printk(KERN_ALERT "%s: Corrupted page table at address %lx\n",
 	       tsk->comm, address);
 	dump_pagetable(address);
-	tsk = current;
 	tsk->thread.cr2 = address;
 	tsk->thread.trap_no = 14;
 	tsk->thread.error_code = error_code;
#1 lore raw
Quoted 29 lines · Uros Bizjak

On Wed, Jan 21, 2009 at 10:13 PM, Mikael Pettersson <[email protected]> wrote:

Impact: Cleanup.

Remove unneeded assignment to tsk in recent x86 change.

Quoted 8 lines
Quoted 2 lines

Hm, I'm not sure I see the inconsistency here. Care to explain this inconsistency in a couple of words?

You're initialising some variables in their declarations, and some using assignments at the start of the procedure body. In particular, for some reason you don't initialise 'mm' in its declaration even though you could do so for consistency with 'tsk'.

Quoted 5 lines

However, I'm strongly in favour of separating declarations and initialisations (esp. ones that need actual computations), so rather than subjecting 'mm' to the treatment you gave 'tsk', just leave the code alone.

Patch v2 with the second hunk removed is attached to this message.

Thanks,
Uros.

arch/x86/mm/fault.c +0 -0
index 93a563b..621e9b3 100644

arch/x86/mm/fault.c static noinline void pgtable_bad(struct pt_regs *regs, · line 426

Quoted 7 lines
arch/x86/mm/fault.c +0 -1
@@ -421,7 +421,6 @@ static noinline void pgtable_bad(struct pt_regs *regs,
 	printk(KERN_ALERT "%s: Corrupted page table at address %lx\n",
 	       tsk->comm, address);
 	dump_pagetable(address);
-	tsk = current;
 	tsk->thread.cr2 = address;
 	tsk->thread.trap_no = 14;
 	tsk->thread.error_code = error_code;

ACKed, but an equivalent patch from Johannes Weiner has already been committed to the x86 git tree.