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] [thread-next>] [day] [month] [year] [list]
Message-ID: <9bdf420c-f716-2a18-4b68-a8c6331eeb39@arm.com>
Date: Mon, 19 Feb 2024 15:36:56 +0000
From: James Clark <james.clark@....com>
To: "Ricardo B. Marliere" <ricardo@...liere.net>,
 Suzuki K Poulose <suzuki.poulose@....com>
Cc: coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
 linux-kernel@...r.kernel.org, Greg Kroah-Hartman
 <gregkh@...uxfoundation.org>, Mike Leach <mike.leach@...aro.org>,
 Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: Re: [PATCH] coresight: constify the struct device_type usage



On 19/02/2024 13:43, Ricardo B. Marliere wrote:
> Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
> core can properly handle constant struct device_type. Move the
> coresight_dev_type variable to be a constant structure as well, placing it
> into read-only memory which can not be modified at runtime.
> 
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@...liere.net>
> ---
>  drivers/hwtracing/coresight/coresight-priv.h  | 2 +-
>  drivers/hwtracing/coresight/coresight-sysfs.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
> index eb365236f9a9..ca3362cbdb70 100644
> --- a/drivers/hwtracing/coresight/coresight-priv.h
> +++ b/drivers/hwtracing/coresight/coresight-priv.h
> @@ -13,7 +13,7 @@
>  #include <linux/pm_runtime.h>
>  
>  extern struct mutex coresight_mutex;
> -extern struct device_type coresight_dev_type[];
> +extern const struct device_type coresight_dev_type[];
>  
>  /*
>   * Coresight management registers (0xf00-0xfcc)
> diff --git a/drivers/hwtracing/coresight/coresight-sysfs.c b/drivers/hwtracing/coresight/coresight-sysfs.c
> index f9444e2cb1d9..1e67cc7758d7 100644
> --- a/drivers/hwtracing/coresight/coresight-sysfs.c
> +++ b/drivers/hwtracing/coresight/coresight-sysfs.c
> @@ -377,7 +377,7 @@ static struct attribute *coresight_source_attrs[] = {
>  };
>  ATTRIBUTE_GROUPS(coresight_source);
>  
> -struct device_type coresight_dev_type[] = {
> +const struct device_type coresight_dev_type[] = {
>  	[CORESIGHT_DEV_TYPE_SINK] = {
>  		.name = "sink",
>  		.groups = coresight_sink_groups,
> 
> ---
> base-commit: c099fdd218a0fedfe87e0b88d2ba0667eab3b3c8
> change-id: 20240219-device_cleanup-coresight-00ba00fd5f21
> 
> Best regards,


Reviewed-by: James Clark <james.clark@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ