From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Geliang Tang <geliangtang@163.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] driver core: bus: add a new helper to_driver_private_bus
Date: Tue, 9 Feb 2016 17:25:15 -0800 [thread overview]
Message-ID: <20160210012515.GA15042@kroah.com> (raw)
In-Reply-To: <ccc6121866d24b43fb5e413f64ee0518af47d81d.1452006001.git.geliangtang@163.com>
On Tue, Jan 05, 2016 at 11:03:39PM +0800, Geliang Tang wrote:
> Add a new helper to_driver_private_bus() for consistency with
> to_device_private_bus() and use it in bus.c.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> drivers/base/base.h | 2 ++
> drivers/base/bus.c | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/base.h b/drivers/base/base.h
> index e05db38..88119d6 100644
> --- a/drivers/base/base.h
> +++ b/drivers/base/base.h
> @@ -51,6 +51,8 @@ struct driver_private {
> struct device_driver *driver;
> };
> #define to_driver(obj) container_of(obj, struct driver_private, kobj)
> +#define to_driver_private_bus(obj) \
> + container_of(obj, struct driver_private, knode_bus)
>
> /**
> * struct device_private - structure to hold the private to the driver core portions of the device structure.
> diff --git a/drivers/base/bus.c b/drivers/base/bus.c
> index 6470eb8..ddc2b0b 100644
> --- a/drivers/base/bus.c
> +++ b/drivers/base/bus.c
> @@ -422,7 +422,7 @@ static struct device_driver *next_driver(struct klist_iter *i)
> struct driver_private *drv_priv;
>
> if (n) {
> - drv_priv = container_of(n, struct driver_private, knode_bus);
> + drv_priv = to_driver_private_bus(n);
No need for a macro in a .h file that is only used in one place in one
file, right?
prev parent reply other threads:[~2016-02-10 1:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-05 15:03 [PATCH 1/3] driver core: bus: use list_for_each_entry* Geliang Tang
2016-01-05 15:03 ` [PATCH 2/3] driver core: bus: use to_subsys_private and to_device_private_bus Geliang Tang
2016-01-05 15:03 ` [PATCH 3/3] driver core: bus: add a new helper to_driver_private_bus Geliang Tang
2016-02-10 1:25 ` Greg Kroah-Hartman [this message]
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=20160210012515.GA15042@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=geliangtang@163.com \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®