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]
Message-ID: <CADnq5_MX7gnjaZziktVUxbCo+GCfnKo_RvAD6ELpoE0VGo_eTQ@mail.gmail.com>
Date:   Fri, 17 Feb 2023 15:15:39 -0500
From:   Alex Deucher <alexdeucher@...il.com>
To:     Thomas Weißschuh <linux@...ssschuh.net>
Cc:     Felix Kuehling <Felix.Kuehling@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amdkfd: Make kobj_type structures constant

Applied.  Thanks!

Alex

On Wed, Feb 15, 2023 at 8:09 PM Thomas Weißschuh <linux@...ssschuh.net> wrote:
>
> Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
> the driver core allows the usage of const struct kobj_type.
>
> Take advantage of this to constify the structure definitions to prevent
> modification at runtime.
>
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_process.c  |  8 ++++----
>  drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 10 +++++-----
>  2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> index 51b1683ac5c1..8d719f90db40 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> @@ -344,7 +344,7 @@ static const struct sysfs_ops kfd_procfs_ops = {
>         .show = kfd_procfs_show,
>  };
>
> -static struct kobj_type procfs_type = {
> +static const struct kobj_type procfs_type = {
>         .release = kfd_procfs_kobj_release,
>         .sysfs_ops = &kfd_procfs_ops,
>  };
> @@ -469,7 +469,7 @@ static const struct sysfs_ops procfs_queue_ops = {
>         .show = kfd_procfs_queue_show,
>  };
>
> -static struct kobj_type procfs_queue_type = {
> +static const struct kobj_type procfs_queue_type = {
>         .sysfs_ops = &procfs_queue_ops,
>         .default_groups = procfs_queue_groups,
>  };
> @@ -478,7 +478,7 @@ static const struct sysfs_ops procfs_stats_ops = {
>         .show = kfd_procfs_stats_show,
>  };
>
> -static struct kobj_type procfs_stats_type = {
> +static const struct kobj_type procfs_stats_type = {
>         .sysfs_ops = &procfs_stats_ops,
>         .release = kfd_procfs_kobj_release,
>  };
> @@ -487,7 +487,7 @@ static const struct sysfs_ops sysfs_counters_ops = {
>         .show = kfd_sysfs_counters_show,
>  };
>
> -static struct kobj_type sysfs_counters_type = {
> +static const struct kobj_type sysfs_counters_type = {
>         .sysfs_ops = &sysfs_counters_ops,
>         .release = kfd_procfs_kobj_release,
>  };
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> index 3fdaba56be6f..8e4124dcb6e4 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> @@ -278,7 +278,7 @@ static const struct sysfs_ops sysprops_ops = {
>         .show = sysprops_show,
>  };
>
> -static struct kobj_type sysprops_type = {
> +static const struct kobj_type sysprops_type = {
>         .release = kfd_topology_kobj_release,
>         .sysfs_ops = &sysprops_ops,
>  };
> @@ -318,7 +318,7 @@ static const struct sysfs_ops iolink_ops = {
>         .show = iolink_show,
>  };
>
> -static struct kobj_type iolink_type = {
> +static const struct kobj_type iolink_type = {
>         .release = kfd_topology_kobj_release,
>         .sysfs_ops = &iolink_ops,
>  };
> @@ -350,7 +350,7 @@ static const struct sysfs_ops mem_ops = {
>         .show = mem_show,
>  };
>
> -static struct kobj_type mem_type = {
> +static const struct kobj_type mem_type = {
>         .release = kfd_topology_kobj_release,
>         .sysfs_ops = &mem_ops,
>  };
> @@ -395,7 +395,7 @@ static const struct sysfs_ops cache_ops = {
>         .show = kfd_cache_show,
>  };
>
> -static struct kobj_type cache_type = {
> +static const struct kobj_type cache_type = {
>         .release = kfd_topology_kobj_release,
>         .sysfs_ops = &cache_ops,
>  };
> @@ -566,7 +566,7 @@ static const struct sysfs_ops node_ops = {
>         .show = node_show,
>  };
>
> -static struct kobj_type node_type = {
> +static const struct kobj_type node_type = {
>         .release = kfd_topology_kobj_release,
>         .sysfs_ops = &node_ops,
>  };
>
> ---
> base-commit: 033c40a89f55525139fd5b6342281b09b97d05bf
> change-id: 20230216-kobj_type-amdkfd-abd9fe9ab060
>
> Best regards,
> --
> Thomas Weißschuh <linux@...ssschuh.net>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ