LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 3/3] driver core: Replace open-coded list_last_entry()
Date: Mon, 9 Mar 2020 16:11:11 +0200 [thread overview]
Message-ID: <20200309141111.40576-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200309141111.40576-1-andriy.shevchenko@linux.intel.com>
There is a place in the code where open-coded version of list entry accessors
list_last_entry() is used.
Replace that with the standard macro.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/base/dd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index efd0e4c16ba5..27a4d51b5bba 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -1226,7 +1226,7 @@ void driver_detach(struct device_driver *drv)
spin_unlock(&drv->p->klist_devices.k_lock);
break;
}
- dev_prv = list_entry(drv->p->klist_devices.k_list.prev,
+ dev_prv = list_last_entry(&drv->p->klist_devices.k_list,
struct device_private,
knode_driver.n_node);
dev = dev_prv->device;
--
2.25.1
next prev parent reply other threads:[~2020-03-09 14:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 14:11 [PATCH v1 1/3] driver core: Break infinite loop when deferred probe can't be satisfied Andy Shevchenko
2020-03-09 14:11 ` [PATCH v1 2/3] driver core: Read atomic counter once in driver_probe_done() Andy Shevchenko
2020-03-18 23:49 ` Ferry Toth
2020-03-09 14:11 ` Andy Shevchenko [this message]
2020-03-11 8:32 ` [PATCH v1 1/3] driver core: Break infinite loop when deferred probe can't be satisfied Peter Ujfalusi
2020-03-12 10:54 ` Andy Shevchenko
2020-03-13 7:35 ` Peter Ujfalusi
2020-03-13 8:50 ` Andy Shevchenko
2020-03-18 23:47 ` Ferry Toth
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=20200309141111.40576-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--subject='Re: [PATCH v1 3/3] driver core: Replace open-coded list_last_entry()' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).