All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Das, Nirmoy" <nirmoy.das@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: make kobj attributes const
Date: Wed, 15 Mar 2023 12:21:04 +0200	[thread overview]
Message-ID: <87o7ou5n8v.fsf@intel.com> (raw)
In-Reply-To: <2c3efd89-ca2f-6d89-7602-9805d9974fe0@linux.intel.com>

On Thu, 09 Mar 2023, "Das, Nirmoy" <nirmoy.das@linux.intel.com> wrote:
> On 3/9/2023 9:16 AM, Jani Nikula wrote:
>> There's no need for any of these to be mutable, constify:
>>
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000020 files.0
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000050 files.1
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 preempt_timeout_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 timeslice_duration_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 timeslice_duration_def
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 preempt_timeout_def
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 max_spin_def
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 stop_timeout_def
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 heartbeat_interval_def
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 name_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 class_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 inst_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 mmio_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 caps_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 all_caps_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 max_spin_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 stop_timeout_attr
>> drivers/gpu/drm/i915/gt/sysfs_engines.o: .data	0000000000000038 heartbeat_interval_attr
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
>
> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>

Thanks for the reviews, pushed to drm-intel-gt-next.

BR,
Jani.

>
>> ---
>>   drivers/gpu/drm/i915/gt/sysfs_engines.c | 36 ++++++++++++-------------
>>   1 file changed, 18 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/sysfs_engines.c b/drivers/gpu/drm/i915/gt/sysfs_engines.c
>> index 7eae3265f8cd..021f51d9b456 100644
>> --- a/drivers/gpu/drm/i915/gt/sysfs_engines.c
>> +++ b/drivers/gpu/drm/i915/gt/sysfs_engines.c
>> @@ -27,7 +27,7 @@ name_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%s\n", kobj_to_engine(kobj)->name);
>>   }
>>   
>> -static struct kobj_attribute name_attr =
>> +static const struct kobj_attribute name_attr =
>>   __ATTR(name, 0444, name_show, NULL);
>>   
>>   static ssize_t
>> @@ -36,7 +36,7 @@ class_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%d\n", kobj_to_engine(kobj)->uabi_class);
>>   }
>>   
>> -static struct kobj_attribute class_attr =
>> +static const struct kobj_attribute class_attr =
>>   __ATTR(class, 0444, class_show, NULL);
>>   
>>   static ssize_t
>> @@ -45,7 +45,7 @@ inst_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%d\n", kobj_to_engine(kobj)->uabi_instance);
>>   }
>>   
>> -static struct kobj_attribute inst_attr =
>> +static const struct kobj_attribute inst_attr =
>>   __ATTR(instance, 0444, inst_show, NULL);
>>   
>>   static ssize_t
>> @@ -54,7 +54,7 @@ mmio_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "0x%x\n", kobj_to_engine(kobj)->mmio_base);
>>   }
>>   
>> -static struct kobj_attribute mmio_attr =
>> +static const struct kobj_attribute mmio_attr =
>>   __ATTR(mmio_base, 0444, mmio_show, NULL);
>>   
>>   static const char * const vcs_caps[] = {
>> @@ -125,7 +125,7 @@ caps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return __caps_show(engine, engine->uabi_capabilities, buf, true);
>>   }
>>   
>> -static struct kobj_attribute caps_attr =
>> +static const struct kobj_attribute caps_attr =
>>   __ATTR(capabilities, 0444, caps_show, NULL);
>>   
>>   static ssize_t
>> @@ -134,7 +134,7 @@ all_caps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return __caps_show(kobj_to_engine(kobj), -1, buf, false);
>>   }
>>   
>> -static struct kobj_attribute all_caps_attr =
>> +static const struct kobj_attribute all_caps_attr =
>>   __ATTR(known_capabilities, 0444, all_caps_show, NULL);
>>   
>>   static ssize_t
>> @@ -183,7 +183,7 @@ max_spin_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%lu\n", engine->props.max_busywait_duration_ns);
>>   }
>>   
>> -static struct kobj_attribute max_spin_attr =
>> +static const struct kobj_attribute max_spin_attr =
>>   __ATTR(max_busywait_duration_ns, 0644, max_spin_show, max_spin_store);
>>   
>>   static ssize_t
>> @@ -194,7 +194,7 @@ max_spin_default(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%lu\n", engine->defaults.max_busywait_duration_ns);
>>   }
>>   
>> -static struct kobj_attribute max_spin_def =
>> +static const struct kobj_attribute max_spin_def =
>>   __ATTR(max_busywait_duration_ns, 0444, max_spin_default, NULL);
>>   
>>   static ssize_t
>> @@ -237,7 +237,7 @@ timeslice_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%lu\n", engine->props.timeslice_duration_ms);
>>   }
>>   
>> -static struct kobj_attribute timeslice_duration_attr =
>> +static const struct kobj_attribute timeslice_duration_attr =
>>   __ATTR(timeslice_duration_ms, 0644, timeslice_show, timeslice_store);
>>   
>>   static ssize_t
>> @@ -248,7 +248,7 @@ timeslice_default(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%lu\n", engine->defaults.timeslice_duration_ms);
>>   }
>>   
>> -static struct kobj_attribute timeslice_duration_def =
>> +static const struct kobj_attribute timeslice_duration_def =
>>   __ATTR(timeslice_duration_ms, 0444, timeslice_default, NULL);
>>   
>>   static ssize_t
>> @@ -288,7 +288,7 @@ stop_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%lu\n", engine->props.stop_timeout_ms);
>>   }
>>   
>> -static struct kobj_attribute stop_timeout_attr =
>> +static const struct kobj_attribute stop_timeout_attr =
>>   __ATTR(stop_timeout_ms, 0644, stop_show, stop_store);
>>   
>>   static ssize_t
>> @@ -299,7 +299,7 @@ stop_default(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%lu\n", engine->defaults.stop_timeout_ms);
>>   }
>>   
>> -static struct kobj_attribute stop_timeout_def =
>> +static const struct kobj_attribute stop_timeout_def =
>>   __ATTR(stop_timeout_ms, 0444, stop_default, NULL);
>>   
>>   static ssize_t
>> @@ -344,7 +344,7 @@ preempt_timeout_show(struct kobject *kobj, struct kobj_attribute *attr,
>>   	return sysfs_emit(buf, "%lu\n", engine->props.preempt_timeout_ms);
>>   }
>>   
>> -static struct kobj_attribute preempt_timeout_attr =
>> +static const struct kobj_attribute preempt_timeout_attr =
>>   __ATTR(preempt_timeout_ms, 0644, preempt_timeout_show, preempt_timeout_store);
>>   
>>   static ssize_t
>> @@ -356,7 +356,7 @@ preempt_timeout_default(struct kobject *kobj, struct kobj_attribute *attr,
>>   	return sysfs_emit(buf, "%lu\n", engine->defaults.preempt_timeout_ms);
>>   }
>>   
>> -static struct kobj_attribute preempt_timeout_def =
>> +static const struct kobj_attribute preempt_timeout_def =
>>   __ATTR(preempt_timeout_ms, 0444, preempt_timeout_default, NULL);
>>   
>>   static ssize_t
>> @@ -400,7 +400,7 @@ heartbeat_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%lu\n", engine->props.heartbeat_interval_ms);
>>   }
>>   
>> -static struct kobj_attribute heartbeat_interval_attr =
>> +static const struct kobj_attribute heartbeat_interval_attr =
>>   __ATTR(heartbeat_interval_ms, 0644, heartbeat_show, heartbeat_store);
>>   
>>   static ssize_t
>> @@ -411,7 +411,7 @@ heartbeat_default(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
>>   	return sysfs_emit(buf, "%lu\n", engine->defaults.heartbeat_interval_ms);
>>   }
>>   
>> -static struct kobj_attribute heartbeat_interval_def =
>> +static const struct kobj_attribute heartbeat_interval_def =
>>   __ATTR(heartbeat_interval_ms, 0444, heartbeat_default, NULL);
>>   
>>   static void kobj_engine_release(struct kobject *kobj)
>> @@ -447,7 +447,7 @@ kobj_engine(struct kobject *dir, struct intel_engine_cs *engine)
>>   
>>   static void add_defaults(struct kobj_engine *parent)
>>   {
>> -	static const struct attribute *files[] = {
>> +	static const struct attribute * const files[] = {
>>   		&max_spin_def.attr,
>>   		&stop_timeout_def.attr,
>>   #if CONFIG_DRM_I915_HEARTBEAT_INTERVAL
>> @@ -483,7 +483,7 @@ static void add_defaults(struct kobj_engine *parent)
>>   
>>   void intel_engines_add_sysfs(struct drm_i915_private *i915)
>>   {
>> -	static const struct attribute *files[] = {
>> +	static const struct attribute * const files[] = {
>>   		&name_attr.attr,
>>   		&class_attr.attr,
>>   		&inst_attr.attr,

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-03-15 10:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  8:16 [Intel-gfx] [PATCH] drm/i915/gt: make kobj attributes const Jani Nikula
2023-03-09 10:10 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2023-03-09 10:57 ` [Intel-gfx] [PATCH] " Andrzej Hajda
2023-03-09 12:47   ` Jani Nikula
2023-03-09 11:08 ` Das, Nirmoy
2023-03-15 10:21   ` Jani Nikula [this message]
2023-03-09 11:56 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gt: make kobj attributes const (rev2) Patchwork
2023-03-11  1:26 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=87o7ou5n8v.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=nirmoy.das@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.