From: Mikael Pettersson <mikpe@it.uu.se>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: Mikael Pettersson <mikpe@it.uu.se>, linux-kernel@vger.kernel.org
Subject: Re: [patch] x86: Unneeded assignment to tsk in recent x86 change
Date: Wed, 21 Jan 2009 22:13:55 +0100 [thread overview]
Message-ID: <18807.36883.413974.491276@harpo.it.uu.se> (raw)
In-Reply-To: <49777DF5.1080107@gmail.com>
Uros Bizjak writes:
> Mikael Pettersson wrote:
>
> > > Impact: Cleanup.
> > >
> > > Remove unneeded assignment to tsk in recent x86 change [1].
> >
> >
> > > @@ -795,13 +794,12 @@ asmlinkage
> > > void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
> > > {
> > > unsigned long address;
> > > - struct task_struct *tsk;
> > > + struct task_struct *tsk = current;
> > > struct mm_struct *mm;
> > > struct vm_area_struct *vma;
> > > int write;
> > > int fault;
> > >
> > > - tsk = current;
> > > mm = tsk->mm;
> > > prefetchw(&mm->mmap_sem);
> >
> > but this is neither a fix nor IMO a cleanup (it's inconsistent with
> > the other variables in that function)
> >
>
> 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'.
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.
prev parent reply other threads:[~2009-01-21 21:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 12:32 Uros Bizjak
2009-01-21 13:06 ` Mikael Pettersson
2009-01-21 19:56 ` Uros Bizjak
2009-01-21 21:13 ` Mikael Pettersson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18807.36883.413974.491276@harpo.it.uu.se \
--to=mikpe@it.uu.se \
--cc=linux-kernel@vger.kernel.org \
--cc=ubizjak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®