Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1703662

[PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group structures.

From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group structures.
Date 2017-08-04 07:10 +0200
Message-ID <uaD22-2Em-31@gated-at.bofh.it> (permalink)
References <uaD21-2Em-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/gpu/drm/i915/i915_sysfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 1eef3fa..3fe3e56 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -96,7 +96,7 @@ static u32 calc_residency(struct drm_i915_private *dev_priv,
 	NULL
 };
 
-static struct attribute_group rc6_attr_group = {
+static const struct attribute_group rc6_attr_group = {
 	.name = power_group_name,
 	.attrs =  rc6_attrs
 };
@@ -107,7 +107,7 @@ static u32 calc_residency(struct drm_i915_private *dev_priv,
 	NULL
 };
 
-static struct attribute_group rc6p_attr_group = {
+static const struct attribute_group rc6p_attr_group = {
 	.name = power_group_name,
 	.attrs =  rc6p_attrs
 };
@@ -117,7 +117,7 @@ static u32 calc_residency(struct drm_i915_private *dev_priv,
 	NULL
 };
 
-static struct attribute_group media_rc6_attr_group = {
+static const struct attribute_group media_rc6_attr_group = {
 	.name = power_group_name,
 	.attrs =  media_rc6_attrs
 };
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/11] constify i915 attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 07:10 +0200
  [PATCH 11/11] drm: i915: i915_sysfs: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 07:10 +0200
  [PATCH 06/11] drm: i915: i915_oa_hsw: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 07:10 +0200
  [PATCH 08/11] drm: i915: i915_oa_sklgt2: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 07:10 +0200
  [PATCH 02/11] drm: i915: i915_oa_bdw: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 07:10 +0200
  [PATCH 04/11] drm: i915: i915_oa_chv: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 07:10 +0200
  [PATCH 03/11] drm: i915: i915_oa_bxt: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 07:10 +0200
  Re: [Intel-gfx] [PATCH 00/11] constify i915 attribute_group  structures. Lionel Landwerlin <lionel.g.landwerlin@intel.com> - 2017-08-04 11:10 +0200
    Re: [Intel-gfx] [PATCH 00/11] constify i915 attribute_group  structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 12:30 +0200
      Re: [Intel-gfx] [PATCH 00/11] constify i915 attribute_group  structures. Lionel Landwerlin <lionel.g.landwerlin@intel.com> - 2017-08-04 12:40 +0200

csiph-web