Linux bluetooth development
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: marcel@holtmann.org, gustavo@padovan.org,
	johan.hedberg@gmail.com, davem@davemloft.net,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: cmtp: Do not use list_for_each_safe when not needed
Date: Thu, 16 Jul 2015 22:52:24 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1507162251580.2797@hadrien> (raw)
In-Reply-To: <7a32b5e113be6344c436791e5ce7c17e8f2b4e68.1437077656.git.christophe.jaillet@wanadoo.fr>

On Thu, 16 Jul 2015, Christophe JAILLET wrote:

> There is no need to use the safe version of list_for_each here.
Why not list_for_each_entry?  Maybe it's too much of a change to make at
once...

julia

>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  net/bluetooth/cmtp/capi.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
> index b0c6c6a..4c5e3e0 100644
> --- a/net/bluetooth/cmtp/capi.c
> +++ b/net/bluetooth/cmtp/capi.c
> @@ -100,9 +100,9 @@ static void cmtp_application_del(struct cmtp_session *session, struct cmtp_appli
>  static struct cmtp_application *cmtp_application_get(struct cmtp_session *session, int pattern, __u16 value)
>  {
>  	struct cmtp_application *app;
> -	struct list_head *p, *n;
> +	struct list_head *p;
>
> -	list_for_each_safe(p, n, &session->applications) {
> +	list_for_each(p, &session->applications) {
>  		app = list_entry(p, struct cmtp_application, list);
>  		switch (pattern) {
>  		case CMTP_MSGNUM:
> @@ -511,13 +511,13 @@ static int cmtp_proc_show(struct seq_file *m, void *v)
>  	struct capi_ctr *ctrl = m->private;
>  	struct cmtp_session *session = ctrl->driverdata;
>  	struct cmtp_application *app;
> -	struct list_head *p, *n;
> +	struct list_head *p;
>
>  	seq_printf(m, "%s\n\n", cmtp_procinfo(ctrl));
>  	seq_printf(m, "addr %s\n", session->name);
>  	seq_printf(m, "ctrl %d\n", session->num);
>
> -	list_for_each_safe(p, n, &session->applications) {
> +	list_for_each(p,  &session->applications) {
>  		app = list_entry(p, struct cmtp_application, list);
>  		seq_printf(m, "appl %d -> %d\n", app->appl, app->mapping);
>  	}
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2015-07-16 20:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 20:17 [PATCH] Bluetooth: cmtp: Do not use list_for_each_safe when not needed Christophe JAILLET
2015-07-16 20:52 ` Julia Lawall [this message]
2015-07-30 11:51 ` Marcel Holtmann

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=alpine.DEB.2.10.1507162251580.2797@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.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