From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E658AC4828F for ; Sat, 3 Feb 2024 06:38:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FDE910F3D8; Sat, 3 Feb 2024 06:38:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="a+00hCh5"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E61110F3D8 for ; Sat, 3 Feb 2024 06:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706942281; x=1738478281; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=U0Gt1ghLOj/MpdqbzS57xAzpG8B7gmg7lnDFYWXXVvY=; b=a+00hCh5V30z3PEt6soP/cdczQaJ5MCcXkTNLgY8PxAoO7nubfuloWHv V/kQG7Xn/8EBBXa+0Qcy/ix5kCWAu0/O/3sC7osGTdaEtDjeB0ZLQUv5t DUVJWCEb/WNqwu8p+QWEn0MXB3i2UvpInyzWU2Kl/CectXtQN9ZZ6+WBF mPn8tz7GKKPM/NJV1Y2drNoIwVhN2s/aYuQoq8CfWMJeGQXFIv860mMoY soR2Vs7W4oWWj0U4he3+6tS0Yu3Ub4hwjqd4YS+/ehacEwmpPzhSNrmUC MZ6HxSCI7jFAnRoSllXzpHKJFUZcndUZIjvXys/XLqW2nIbaD9CXguceR w==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="394722522" X-IronPort-AV: E=Sophos;i="6.05,238,1701158400"; d="scan'208";a="394722522" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 22:37:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,238,1701158400"; d="scan'208";a="584151" Received: from orsosgc001.jf.intel.com (HELO unerlige-ril.intel.com) ([10.165.21.138]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 22:37:56 -0800 Date: Fri, 02 Feb 2024 22:37:55 -0800 Message-ID: <85bk8yaw8s.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Lucas De Marchi Cc: intel-xe@lists.freedesktop.org, Riana Tauro , Badal Nilawar Subject: Re: [PATCH] drm/xe/xe_gt_idle: Drop redundant newline in name In-Reply-To: References: <20240202225623.3225443-1-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-redhat-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Fri, 02 Feb 2024 21:36:58 -0800, Lucas De Marchi wrote: > Hi Lucas, > 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? No, these are actually ok, they don't add 2 newlines like the ones I fixed. It would probably have been better to use sysfs_emit to emit these values, instead of sprintf, but they don't add an additional newline. So if you want I can add a patch which changes these to sysfs_emit, but maybe not needed, and that would be a second patch. Thanks. -- Ashutosh