Re: [PATCH V2] kernel/kprobes.c: code clean-up

From: Joe Perches
Date: Thu May 08 2014 - 13:55:58 EST


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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/