mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	akpm <akpm@linux-foundation.org>
Subject: Re: [PATCH V2] kernel/kprobes.c: code clean-up
Date: Thu, 08 May 2014 10:55:50 -0700	[thread overview]
Message-ID: <1399571750.8479.2.camel@joe-AO725> (raw)
In-Reply-To: <20140508194500.87f823c9463a59238878ccd4@skynet.be>

On Thu, 2014-05-08 at 19:45 +0200, Fabian Frederick wrote:
> -Simplify __get_valid_kprobe (by Joe Perches)

Hello Fabian.

This bit should probably be a separate patch.

> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
[]
> @@ -1382,15 +1384,16 @@ static struct kprobe * __kprobes __get_valid_kprobe(struct kprobe *p)
>  	if (unlikely(!ap))
>  		return NULL;
>  
> -	if (p != ap) {
> -		list_for_each_entry_rcu(list_p, &ap->list, list)
> -			if (list_p == p)
> -			/* kprobe p is a valid probe */
> -				goto valid;
> -		return NULL;
> +	if (p == ap)
> +		return ap;
> +
> +	/* Make sure p is a valid probe*/
> +	list_for_each_entry_rcu(list_p, &ap->list, list){

Missing space between "){"

> +		if (list_p == p)
> +			return ap;
>  	}
> -valid:
> -	return ap;
> +
> +	return NULL;
>  }
>  
>  /* Return error if the kprobe is being re-registered */

Please remember to use scripts/checkpatch.pl on your patches
before sending them.



      reply	other threads:[~2014-05-08 17:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 17:45 Fabian Frederick
2014-05-08 17:55 ` Joe Perches [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=1399571750.8479.2.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=fabf@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    /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®