From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
Rikard Falkeborn <rikard.falkeborn@gmail.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH 4/7] intel_th: Constify attribute_group structs
Date: Wed, 14 Apr 2021 20:12:48 +0300 [thread overview]
Message-ID: <20210414171251.14672-5-alexander.shishkin@linux.intel.com> (raw)
In-Reply-To: <20210414171251.14672-1-alexander.shishkin@linux.intel.com>
From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
The only usage of them is to pass their address to sysfs_create_group()
and sysfs_remove_group(), both which have pointers to const
attribute_group structs as input. Make them const to allow the compiler
to put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/hwtracing/intel_th/intel_th.h | 2 +-
drivers/hwtracing/intel_th/msu.c | 2 +-
drivers/hwtracing/intel_th/pti.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hwtracing/intel_th/intel_th.h b/drivers/hwtracing/intel_th/intel_th.h
index 05fa2dab37d1..89c67e0e1d34 100644
--- a/drivers/hwtracing/intel_th/intel_th.h
+++ b/drivers/hwtracing/intel_th/intel_th.h
@@ -178,7 +178,7 @@ struct intel_th_driver {
/* file_operations for those who want a device node */
const struct file_operations *fops;
/* optional attributes */
- struct attribute_group *attr_group;
+ const struct attribute_group *attr_group;
/* source ops */
int (*set_output)(struct intel_th_device *thdev,
diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index 7d95242db900..2edc4666633d 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -2095,7 +2095,7 @@ static struct attribute *msc_output_attrs[] = {
NULL,
};
-static struct attribute_group msc_output_group = {
+static const struct attribute_group msc_output_group = {
.attrs = msc_output_attrs,
};
diff --git a/drivers/hwtracing/intel_th/pti.c b/drivers/hwtracing/intel_th/pti.c
index 0da6b787f553..09132ab8bc23 100644
--- a/drivers/hwtracing/intel_th/pti.c
+++ b/drivers/hwtracing/intel_th/pti.c
@@ -142,7 +142,7 @@ static struct attribute *pti_output_attrs[] = {
NULL,
};
-static struct attribute_group pti_output_group = {
+static const struct attribute_group pti_output_group = {
.attrs = pti_output_attrs,
};
@@ -295,7 +295,7 @@ static struct attribute *lpp_output_attrs[] = {
NULL,
};
-static struct attribute_group lpp_output_group = {
+static const struct attribute_group lpp_output_group = {
.attrs = lpp_output_attrs,
};
--
2.30.2
next prev parent reply other threads:[~2021-04-14 17:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 17:12 [PATCH 0/7] stm class/intel_th: Updates for v5.13 Alexander Shishkin
2021-04-14 17:12 ` [PATCH 1/7] stm class: Remove an unused function Alexander Shishkin
2021-04-14 17:12 ` [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16] Alexander Shishkin
2021-04-14 17:33 ` Greg Kroah-Hartman
2021-04-14 17:47 ` Andy Shevchenko
2021-04-14 18:56 ` Greg Kroah-Hartman
2021-04-14 19:12 ` Andy Shevchenko
2021-04-14 19:14 ` Alexander Shishkin
2021-04-14 19:16 ` Andy Shevchenko
2021-04-15 8:34 ` Greg Kroah-Hartman
2021-04-15 8:48 ` Andy Shevchenko
2021-04-15 9:08 ` Greg Kroah-Hartman
2021-04-15 9:20 ` Alexander Shishkin
2021-04-14 17:12 ` [PATCH 3/7] intel_th: Constify all drvdata references Alexander Shishkin
2021-04-14 17:12 ` Alexander Shishkin [this message]
2021-04-14 17:12 ` [PATCH 5/7] intel_th: Consistency and off-by-one fix Alexander Shishkin
2021-04-14 17:12 ` [PATCH 6/7] intel_th: pci: Add Rocket Lake CPU support Alexander Shishkin
2021-04-14 17:12 ` [PATCH 7/7] intel_th: pci: Add Alder Lake-M support Alexander Shishkin
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=20210414171251.14672-5-alexander.shishkin@linux.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rikard.falkeborn@gmail.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;
as well as URLs for NNTP newsgroup(s).