From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Madhur Kumar <madhurkumar004@gmail.com>
Cc: <lucas.demarchi@intel.com>, <thomas.hellstrom@linux.intel.com>,
<airlied@gmail.com>, <simona@ffwll.ch>,
<intel-xe@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND] drm: xe: Replace sprintf() with sysfs_emit()
Date: Fri, 19 Dec 2025 10:32:34 -0500 [thread overview]
Message-ID: <aUVwEvQxNSRf18Qf@intel.com> (raw)
In-Reply-To: <20251214083659.2412218-1-madhurkumar004@gmail.com>
On Sun, Dec 14, 2025 at 02:06:59PM +0530, Madhur Kumar wrote:
> Replace sprintf() calls with sysfs_emit() to follow current kernel
> coding standards.
>
> sysfs_emit() is the preferred method for formatting sysfs output as it
> provides better bounds checking and is more secure.
>
> Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com>
Thanks for the patch.
I just did a small adjustment in the patch subject while getting it
pushed to drm-xe-next.
[drm-xe-next af90706f0eec] drm/xe/pmu: Replace sprintf() with sysfs_emit()
> ---
> drivers/gpu/drm/xe/xe_pmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pmu.c b/drivers/gpu/drm/xe/xe_pmu.c
> index cab51d826345..f016459c9904 100644
> --- a/drivers/gpu/drm/xe/xe_pmu.c
> +++ b/drivers/gpu/drm/xe/xe_pmu.c
> @@ -425,7 +425,7 @@ static ssize_t event_attr_show(struct device *dev,
> struct perf_pmu_events_attr *pmu_attr =
> container_of(attr, struct perf_pmu_events_attr, attr);
>
> - return sprintf(buf, "event=%#04llx\n", pmu_attr->id);
> + return sysfs_emit(buf, "event=%#04llx\n", pmu_attr->id);
> }
>
> #define XE_EVENT_ATTR(name_, v_, id_) \
> --
> 2.52.0
>
prev parent reply other threads:[~2025-12-19 15:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-14 8:36 [PATCH RESEND] drm: xe: Replace sprintf() with sysfs_emit() Madhur Kumar
2025-12-19 15:32 ` Rodrigo Vivi [this message]
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=aUVwEvQxNSRf18Qf@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=madhurkumar004@gmail.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox