All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-pm@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 3/3] driver core: Replace open-coded list_last_entry()
Date: Tue, 24 Mar 2020 14:20:23 +0200	[thread overview]
Message-ID: <20200324122023.9649-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200324122023.9649-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>
---
v2: no change
 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


  parent reply	other threads:[~2020-03-24 12:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 12:20 [PATCH v2 1/3] driver core: Break infinite loop when deferred probe can't be satisfied Andy Shevchenko
2020-03-24 12:20 ` [PATCH v2 2/3] driver core: Read atomic counter once in driver_probe_done() Andy Shevchenko
2020-03-24 12:55   ` Rafael J. Wysocki
2020-03-24 12:20 ` Andy Shevchenko [this message]
2020-03-24 12:53   ` [PATCH v2 3/3] driver core: Replace open-coded list_last_entry() Rafael J. Wysocki
2020-03-27 17:56     ` Naresh Kamboju
2020-03-27 19:40       ` Robin Murphy
2020-03-30 10:13         ` Sudeep Holla
2020-03-30 10:43           ` Andy Shevchenko
2020-03-30 13:16             ` Sudeep Holla
2020-03-30 12:45           ` Robin Murphy
2020-03-30 13:11             ` Andy Shevchenko
2020-03-30 13:29               ` Robin Murphy
2020-03-30 20:02                 ` John Stultz
2020-03-30 13:25             ` Sudeep Holla
2020-03-28  7:25       ` Greg Kroah-Hartman
2020-03-24 12:52 ` [PATCH v2 1/3] driver core: Break infinite loop when deferred probe can't be satisfied Rafael J. Wysocki
2020-03-24 13:39   ` Andy Shevchenko
2020-03-24 15:36     ` Rafael J. Wysocki
2020-03-24 15:47       ` Andy Shevchenko

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=20200324122023.9649-3-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.