mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: "Ricardo B. Marliere" <ricardo@marliere.net>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	James Clark <james.clark@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] coresight: constify the struct device_type usage
Date: Wed, 21 Feb 2024 09:09:41 +0530	[thread overview]
Message-ID: <3b400f7d-f76c-4e54-92d9-7ece7f712ea8@arm.com> (raw)
In-Reply-To: <20240219-device_cleanup-coresight-v1-1-4a8a0b816183@marliere.net>



On 2/19/24 19:13, 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@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---

Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>

>  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,

  parent reply	other threads:[~2024-02-21  3:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 13:43 Ricardo B. Marliere
2024-02-19 15:36 ` James Clark
2024-02-21  3:39 ` Anshuman Khandual [this message]
2024-06-21  9:30 ` Suzuki K Poulose

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=3b400f7d-f76c-4e54-92d9-7ece7f712ea8@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=james.clark@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=ricardo@marliere.net \
    --cc=suzuki.poulose@arm.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®