Commit 91b93fae authored by Bommu Krishnaiah's avatar Bommu Krishnaiah Committed by Rodrigo Vivi

drm/xe/xe_hw_engine_class_sysfs: use sysfs_emit() for attr's _show()

sprintf() is deprecated for sysfs, use preferred sysfs_emit() instead.

v2: used sysfs_emit instand of sprintf
Signed-off-by: default avatarBommu Krishnaiah <krishnaiah.bommu@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Reviewed-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231209235949.54524-3-krishnaiah.bommu@intel.comSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent a3c86b6d
...@@ -72,7 +72,7 @@ static ssize_t job_timeout_max_show(struct kobject *kobj, ...@@ -72,7 +72,7 @@ static ssize_t job_timeout_max_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.job_timeout_max); return sysfs_emit(buf, "%u\n", eclass->sched_props.job_timeout_max);
} }
static const struct kobj_attribute job_timeout_max_attr = static const struct kobj_attribute job_timeout_max_attr =
...@@ -108,7 +108,7 @@ static ssize_t job_timeout_min_show(struct kobject *kobj, ...@@ -108,7 +108,7 @@ static ssize_t job_timeout_min_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.job_timeout_min); return sysfs_emit(buf, "%u\n", eclass->sched_props.job_timeout_min);
} }
static const struct kobj_attribute job_timeout_min_attr = static const struct kobj_attribute job_timeout_min_attr =
...@@ -141,7 +141,7 @@ static ssize_t job_timeout_show(struct kobject *kobj, ...@@ -141,7 +141,7 @@ static ssize_t job_timeout_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.job_timeout_ms); return sysfs_emit(buf, "%u\n", eclass->sched_props.job_timeout_ms);
} }
static const struct kobj_attribute job_timeout_attr = static const struct kobj_attribute job_timeout_attr =
...@@ -152,7 +152,7 @@ static ssize_t job_timeout_default(struct kobject *kobj, ...@@ -152,7 +152,7 @@ static ssize_t job_timeout_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.job_timeout_ms); return sysfs_emit(buf, "%u\n", eclass->defaults.job_timeout_ms);
} }
static const struct kobj_attribute job_timeout_def = static const struct kobj_attribute job_timeout_def =
...@@ -163,7 +163,7 @@ static ssize_t job_timeout_min_default(struct kobject *kobj, ...@@ -163,7 +163,7 @@ static ssize_t job_timeout_min_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.job_timeout_min); return sysfs_emit(buf, "%u\n", eclass->defaults.job_timeout_min);
} }
static const struct kobj_attribute job_timeout_min_def = static const struct kobj_attribute job_timeout_min_def =
...@@ -174,7 +174,7 @@ static ssize_t job_timeout_max_default(struct kobject *kobj, ...@@ -174,7 +174,7 @@ static ssize_t job_timeout_max_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.job_timeout_max); return sysfs_emit(buf, "%u\n", eclass->defaults.job_timeout_max);
} }
static const struct kobj_attribute job_timeout_max_def = static const struct kobj_attribute job_timeout_max_def =
...@@ -233,7 +233,7 @@ static ssize_t timeslice_duration_max_show(struct kobject *kobj, ...@@ -233,7 +233,7 @@ static ssize_t timeslice_duration_max_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.timeslice_max); return sysfs_emit(buf, "%u\n", eclass->sched_props.timeslice_max);
} }
static const struct kobj_attribute timeslice_duration_max_attr = static const struct kobj_attribute timeslice_duration_max_attr =
...@@ -271,7 +271,7 @@ static ssize_t timeslice_duration_min_show(struct kobject *kobj, ...@@ -271,7 +271,7 @@ static ssize_t timeslice_duration_min_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.timeslice_min); return sysfs_emit(buf, "%u\n", eclass->sched_props.timeslice_min);
} }
static const struct kobj_attribute timeslice_duration_min_attr = static const struct kobj_attribute timeslice_duration_min_attr =
...@@ -283,7 +283,7 @@ static ssize_t timeslice_duration_show(struct kobject *kobj, ...@@ -283,7 +283,7 @@ static ssize_t timeslice_duration_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.timeslice_us); return sysfs_emit(buf, "%u\n", eclass->sched_props.timeslice_us);
} }
static const struct kobj_attribute timeslice_duration_attr = static const struct kobj_attribute timeslice_duration_attr =
...@@ -295,7 +295,7 @@ static ssize_t timeslice_default(struct kobject *kobj, ...@@ -295,7 +295,7 @@ static ssize_t timeslice_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.timeslice_us); return sysfs_emit(buf, "%u\n", eclass->defaults.timeslice_us);
} }
static const struct kobj_attribute timeslice_duration_def = static const struct kobj_attribute timeslice_duration_def =
...@@ -306,7 +306,7 @@ static ssize_t timeslice_min_default(struct kobject *kobj, ...@@ -306,7 +306,7 @@ static ssize_t timeslice_min_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.timeslice_min); return sysfs_emit(buf, "%u\n", eclass->defaults.timeslice_min);
} }
static const struct kobj_attribute timeslice_duration_min_def = static const struct kobj_attribute timeslice_duration_min_def =
...@@ -317,7 +317,7 @@ static ssize_t timeslice_max_default(struct kobject *kobj, ...@@ -317,7 +317,7 @@ static ssize_t timeslice_max_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.timeslice_max); return sysfs_emit(buf, "%u\n", eclass->defaults.timeslice_max);
} }
static const struct kobj_attribute timeslice_duration_max_def = static const struct kobj_attribute timeslice_duration_max_def =
...@@ -350,7 +350,7 @@ static ssize_t preempt_timeout_show(struct kobject *kobj, ...@@ -350,7 +350,7 @@ static ssize_t preempt_timeout_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.preempt_timeout_us); return sysfs_emit(buf, "%u\n", eclass->sched_props.preempt_timeout_us);
} }
static const struct kobj_attribute preempt_timeout_attr = static const struct kobj_attribute preempt_timeout_attr =
...@@ -362,7 +362,7 @@ static ssize_t preempt_timeout_default(struct kobject *kobj, ...@@ -362,7 +362,7 @@ static ssize_t preempt_timeout_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.preempt_timeout_us); return sysfs_emit(buf, "%u\n", eclass->defaults.preempt_timeout_us);
} }
static const struct kobj_attribute preempt_timeout_def = static const struct kobj_attribute preempt_timeout_def =
...@@ -374,7 +374,7 @@ static ssize_t preempt_timeout_min_default(struct kobject *kobj, ...@@ -374,7 +374,7 @@ static ssize_t preempt_timeout_min_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.preempt_timeout_min); return sysfs_emit(buf, "%u\n", eclass->defaults.preempt_timeout_min);
} }
static const struct kobj_attribute preempt_timeout_min_def = static const struct kobj_attribute preempt_timeout_min_def =
...@@ -386,7 +386,7 @@ static ssize_t preempt_timeout_max_default(struct kobject *kobj, ...@@ -386,7 +386,7 @@ static ssize_t preempt_timeout_max_default(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj->parent);
return sprintf(buf, "%u\n", eclass->defaults.preempt_timeout_max); return sysfs_emit(buf, "%u\n", eclass->defaults.preempt_timeout_max);
} }
static const struct kobj_attribute preempt_timeout_max_def = static const struct kobj_attribute preempt_timeout_max_def =
...@@ -422,7 +422,7 @@ static ssize_t preempt_timeout_max_show(struct kobject *kobj, ...@@ -422,7 +422,7 @@ static ssize_t preempt_timeout_max_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.preempt_timeout_max); return sysfs_emit(buf, "%u\n", eclass->sched_props.preempt_timeout_max);
} }
static const struct kobj_attribute preempt_timeout_max_attr = static const struct kobj_attribute preempt_timeout_max_attr =
...@@ -459,7 +459,7 @@ static ssize_t preempt_timeout_min_show(struct kobject *kobj, ...@@ -459,7 +459,7 @@ static ssize_t preempt_timeout_min_show(struct kobject *kobj,
{ {
struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj);
return sprintf(buf, "%u\n", eclass->sched_props.preempt_timeout_min); return sysfs_emit(buf, "%u\n", eclass->sched_props.preempt_timeout_min);
} }
static const struct kobj_attribute preempt_timeout_min_attr = static const struct kobj_attribute preempt_timeout_min_attr =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment