lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0ijwXwctVF_+kLO2-MfP2+r_Mi1nQYEhbfmyypNYBkWvQ@mail.gmail.com>
Date:   Wed, 23 Nov 2022 13:39:45 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Ira Weiny <ira.weiny@...el.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Won Chung <wonchung@...gle.com>
Subject: Re: [PATCH 5/5] driver core: device_get_devnode() should take a const *

On Wed, Nov 23, 2022 at 1:25 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> 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.
>
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Jason Gunthorpe <jgg@...pe.ca>
> Cc: Ira Weiny <ira.weiny@...el.com>
> Cc: Dan Williams <dan.j.williams@...el.com>
> Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Cc: Won Chung <wonchung@...gle.com>
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

Acked-by: Rafael J. Wysocki <rafael@...nel.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);
> +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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ