From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
"Rafael J. Wysocki" <rafael@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Jason Gunthorpe <jgg@ziepe.ca>, Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Won Chung <wonchung@google.com>
Subject: Re: [PATCH 5/5] driver core: device_get_devnode() should take a const *
Date: Wed, 23 Nov 2022 15:36:37 +0200 [thread overview]
Message-ID: <Y34h5QBMTxEn/lzC@smile.fi.intel.com> (raw)
In-Reply-To: <20221123122523.1332370-5-gregkh@linuxfoundation.org>
On Wed, Nov 23, 2022 at 01:25:23PM +0100, Greg Kroah-Hartman wrote:
> device_get_devnode() should take a constant * to struct device as it
> does not modify it in any way, so modify the function definition to do
> this and move it out of device.h as it does not need to be exposed to
> the whole kernel tree.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
(see one nit-pick below)
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Won Chung <wonchung@google.com>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/base/base.h | 2 ++
> drivers/base/core.c | 2 +-
> include/linux/device.h | 2 --
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/base/base.h b/drivers/base/base.h
> index 7d4803c03d3e..a8a119c36bdc 100644
> --- a/drivers/base/base.h
> +++ b/drivers/base/base.h
> @@ -158,6 +158,8 @@ extern void device_block_probing(void);
> extern void device_unblock_probing(void);
> extern void deferred_probe_extend_timeout(void);
> extern void driver_deferred_probe_trigger(void);
I would put a blank line here if the below doesn't belong to the deferral probe
routines.
> +const char *device_get_devnode(const struct device *dev, umode_t *mode,
> + kuid_t *uid, kgid_t *gid, const char **tmp);
>
> /* /sys/devices directory */
> extern struct kset *devices_kset;
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index a3e14143ec0c..72ec54a8a4e1 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -3739,7 +3739,7 @@ static struct device *next_device(struct klist_iter *i)
> * a name. This memory is returned in tmp and needs to be
> * freed by the caller.
> */
> -const char *device_get_devnode(struct device *dev,
> +const char *device_get_devnode(const struct device *dev,
> umode_t *mode, kuid_t *uid, kgid_t *gid,
> const char **tmp)
> {
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 4ad1280713e6..e4498389e866 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -927,8 +927,6 @@ int device_rename(struct device *dev, const char *new_name);
> int device_move(struct device *dev, struct device *new_parent,
> enum dpm_order dpm_order);
> int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid);
> -const char *device_get_devnode(struct device *dev, umode_t *mode, kuid_t *uid,
> - kgid_t *gid, const char **tmp);
> int device_is_dependent(struct device *dev, void *target);
>
> static inline bool device_supports_offline(struct device *dev)
> --
> 2.38.1
>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-11-23 13:48 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-23 12:25 [PATCH 1/5] driver core: make struct class.dev_uevent() " Greg Kroah-Hartman
2022-11-23 12:25 ` [PATCH 2/5] driver core: make struct class.devnode() " Greg Kroah-Hartman
2022-11-25 11:55 ` Mauro Carvalho Chehab
2022-11-25 12:40 ` Sumit Semwal
2022-11-23 12:25 ` [PATCH 3/5] driver core: make struct device_type.uevent() " Greg Kroah-Hartman
2022-11-23 12:38 ` Rafael J. Wysocki
2023-01-11 9:51 ` Greg Kroah-Hartman
2022-11-23 13:14 ` Maximilian Luz
2022-11-23 13:34 ` Andy Shevchenko
2022-11-23 13:59 ` Maximilian Luz
2022-11-23 14:52 ` Matthew Wilcox
2022-11-23 15:14 ` Maximilian Luz
2022-11-23 15:37 ` Greg Kroah-Hartman
2022-11-23 15:48 ` Maximilian Luz
2022-11-23 15:52 ` Greg Kroah-Hartman
2022-11-23 16:25 ` Jason Gunthorpe
2022-11-23 17:01 ` Greg Kroah-Hartman
2022-11-23 17:29 ` Jason Gunthorpe
2022-11-23 17:49 ` Matthew Wilcox
2022-11-23 17:55 ` Jason Gunthorpe
2022-11-23 18:00 ` Matthew Wilcox
2022-12-01 18:43 ` Greg Kroah-Hartman
2022-11-23 18:10 ` Greg Kroah-Hartman
2022-11-23 18:25 ` Jason Gunthorpe
2022-11-23 19:06 ` Greg Kroah-Hartman
2022-11-23 23:24 ` Barnabás Pőcze
2022-11-23 13:56 ` Mika Westerberg
2023-01-11 9:52 ` Greg Kroah-Hartman
2022-11-25 11:56 ` Mauro Carvalho Chehab
2023-01-11 9:52 ` Greg Kroah-Hartman
2022-11-23 12:25 ` [PATCH 4/5] driver core: make struct device_type.devnode() " Greg Kroah-Hartman
2022-11-23 19:23 ` Dan Williams
2023-01-11 9:46 ` Greg Kroah-Hartman
2022-11-23 12:25 ` [PATCH 5/5] driver core: device_get_devnode() should " Greg Kroah-Hartman
2022-11-23 12:39 ` Rafael J. Wysocki
2022-11-23 13:36 ` Andy Shevchenko [this message]
2023-01-11 9:47 ` Greg Kroah-Hartman
2022-11-23 12:38 ` [PATCH 1/5] driver core: make struct class.dev_uevent() " Rafael J. Wysocki
2022-11-24 15:03 ` Sebastian Reichel
2022-11-25 11:54 ` Mauro Carvalho Chehab
2022-11-25 23:51 ` Bart Van Assche
2022-11-27 13:45 ` Greg Kroah-Hartman
2022-11-28 2:38 ` Bart Van Assche
2022-11-28 17:25 ` Greg Kroah-Hartman
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=Y34h5QBMTxEn/lzC@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
--cc=wonchung@google.com \
/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®