[PATCH] drm/xe/xe_gt_idle: Drop redundant newline in name

Lucas De Marchi lucas.demarchi at intel.com
Sat Feb 3 05:36:58 UTC 2024


On Fri, Feb 02, 2024 at 02:56:23PM -0800, Ashutosh Dixit wrote:
>Newline in name is redunant and produces an unnecessary empty line during
>'cat name'. Newline is added during sysfs_emit. See '27a1a1e2e47d ("drm/xe:
>stringify the argument to avoid potential vulnerability")'.

$ git grep sprintf -- drivers/gpu/drm/xe
drivers/gpu/drm/xe/xe_debugfs.c:                        sprintf(name, "vram%d_mm", mem_type - XE_PL_VRAM0);
drivers/gpu/drm/xe/xe_exec_queue.c:             sprintf(q->name, "rcs%d", instance);
drivers/gpu/drm/xe/xe_exec_queue.c:             sprintf(q->name, "vcs%d", instance);
drivers/gpu/drm/xe/xe_exec_queue.c:             sprintf(q->name, "vecs%d", instance);
drivers/gpu/drm/xe/xe_exec_queue.c:             sprintf(q->name, "bcs%d", instance);
drivers/gpu/drm/xe/xe_exec_queue.c:             sprintf(q->name, "ccs%d", instance);
drivers/gpu/drm/xe/xe_exec_queue.c:             sprintf(q->name, "gsccs%d", instance);
drivers/gpu/drm/xe/xe_gt_debugfs.c:     sprintf(name, "gt%d", gt->info.id);
drivers/gpu/drm/xe/xe_gt_idle.c:                sprintf(gtidle->name, "gt%d-mc\n", gt->info.id);
drivers/gpu/drm/xe/xe_gt_idle.c:                sprintf(gtidle->name, "gt%d-rc\n", gt->info.id);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.job_timeout_max);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.job_timeout_min);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.job_timeout_ms);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.job_timeout_ms);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.job_timeout_min);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.job_timeout_max);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.timeslice_max);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.timeslice_min);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.timeslice_us);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.timeslice_us);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.timeslice_min);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.timeslice_max);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.preempt_timeout_us);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.preempt_timeout_us);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.preempt_timeout_min);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->defaults.preempt_timeout_max);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.preempt_timeout_max);
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c:  return sprintf(buf, "%u\n", eclass->sched_props.preempt_timeout_min);
drivers/gpu/drm/xe/xe_hw_fence.c:       sprintf(ctx->name, "%s", name);


it looks like all these in xe_hw_engine_class_sysfs.c have the same
problem. Can you fix them all together?

thanks
Lucas De Marchi


More information about the Intel-xe mailing list