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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 16 Feb 2021 21:33:27 +0200
From:   Oded Gabbay <oded.gabbay@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Oded Gabbay <ogabbay@...nel.org>, Arnd Bergmann <arnd@...db.de>,
        Tomer Tayar <ttayar@...ana.ai>,
        Moti Haimovski <mhaimovski@...ana.ai>,
        Omer Shpigelman <oshpigelman@...ana.ai>,
        Ofir Bitton <obitton@...ana.ai>,
        "Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers: habanalabs: remove unused dentry pointer for
 debugfs files

On Tue, Feb 16, 2021 at 5:08 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> The dentry for the created debugfs file was being saved, but never used
> anywhere.  As the pointer isn't needed for anything, and the debugfs
> files are being properly removed by removing the parent directory,
> remove the saved pointer as well, saving a tiny bit of memory and logic.
>
> Cc: Oded Gabbay <ogabbay@...nel.org>
> Cc: Arnd Bergmann <arnd@...db.de>
> Cc: Tomer Tayar <ttayar@...ana.ai>
> Cc: Moti Haimovski <mhaimovski@...ana.ai>
> Cc: Omer Shpigelman <oshpigelman@...ana.ai>
> Cc: Ofir Bitton <obitton@...ana.ai>
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
>  drivers/misc/habanalabs/common/debugfs.c    | 5 +----
>  drivers/misc/habanalabs/common/habanalabs.h | 2 --
>  2 files changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/misc/habanalabs/common/debugfs.c b/drivers/misc/habanalabs/common/debugfs.c
> index cef716643979..770b0131397d 100644
> --- a/drivers/misc/habanalabs/common/debugfs.c
> +++ b/drivers/misc/habanalabs/common/debugfs.c
> @@ -965,7 +965,6 @@ void hl_debugfs_add_device(struct hl_device *hdev)
>         struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs;
>         int count = ARRAY_SIZE(hl_debugfs_list);
>         struct hl_debugfs_entry *entry;
> -       struct dentry *ent;
>         int i;
>
>         dev_entry->hdev = hdev;
> @@ -1072,13 +1071,11 @@ void hl_debugfs_add_device(struct hl_device *hdev)
>                                 &hl_stop_on_err_fops);
>
>         for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) {
> -
> -               ent = debugfs_create_file(hl_debugfs_list[i].name,
> +               debugfs_create_file(hl_debugfs_list[i].name,
>                                         0444,
>                                         dev_entry->root,
>                                         entry,
>                                         &hl_debugfs_fops);
> -               entry->dent = ent;
>                 entry->info_ent = &hl_debugfs_list[i];
>                 entry->dev_entry = dev_entry;
>         }
> diff --git a/drivers/misc/habanalabs/common/habanalabs.h b/drivers/misc/habanalabs/common/habanalabs.h
> index 60e16dc4bcac..48937e9eed83 100644
> --- a/drivers/misc/habanalabs/common/habanalabs.h
> +++ b/drivers/misc/habanalabs/common/habanalabs.h
> @@ -1393,12 +1393,10 @@ struct hl_info_list {
>
>  /**
>   * struct hl_debugfs_entry - debugfs dentry wrapper.
> - * @dent: base debugfs entry structure.
>   * @info_ent: dentry realted ops.
>   * @dev_entry: ASIC specific debugfs manager.
>   */
>  struct hl_debugfs_entry {
> -       struct dentry                   *dent;
>         const struct hl_info_list       *info_ent;
>         struct hl_dbg_device_entry      *dev_entry;
>  };
> --
> 2.30.1
>

This patch is:
Reviewed-by: Oded Gabbay <ogabbay@...nel.org>

Thanks,
Oded

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ