From: Jonathan Cameron <jic23@kernel.org>
To: Anshul Garg <aksgarg1989@gmail.com>,
knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio/inkern.c Use list_for_each_entry_safe
Date: Sat, 12 Dec 2015 17:23:47 +0000 [thread overview]
Message-ID: <566C5823.3040209@kernel.org> (raw)
In-Reply-To: <1449596756-18133-1-git-send-email-aksgarg1989@gmail.com>
On 08/12/15 17:45, Anshul Garg wrote:
> Use list_for_each_entry_safe instead of list_for_each_safe
> and list_entry call.
>
> Signed-off-by: Anshul Garg <aksgarg1989@gmail.com>
Applied to the togreg branch of iio.git - initially pushed out
as testing for the autobuilder to play with it.
Thanks,
Jonathan
> ---
> drivers/iio/inkern.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index c8bad3c..f764eb6 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -61,12 +61,10 @@ EXPORT_SYMBOL_GPL(iio_map_array_register);
> int iio_map_array_unregister(struct iio_dev *indio_dev)
> {
> int ret = -ENODEV;
> - struct iio_map_internal *mapi;
> - struct list_head *pos, *tmp;
> + struct iio_map_internal *mapi, *next;
>
> mutex_lock(&iio_map_list_lock);
> - list_for_each_safe(pos, tmp, &iio_map_list) {
> - mapi = list_entry(pos, struct iio_map_internal, l);
> + list_for_each_entry_safe(mapi, next, &iio_map_list, l) {
> if (indio_dev == mapi->indio_dev) {
> list_del(&mapi->l);
> kfree(mapi);
>
next prev parent reply other threads:[~2015-12-12 17:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 17:45 [PATCH] iio/inkern.c Use list_for_each_entry_safe Anshul Garg
2015-12-12 17:23 ` Jonathan Cameron [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-12-08 16:42 Anshul Garg
2015-12-08 17:02 ` kbuild test robot
2015-12-08 17:14 ` kbuild test robot
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=566C5823.3040209@kernel.org \
--to=jic23@kernel.org \
--cc=aksgarg1989@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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