From: <ye.xingchen@zte.com.cn>
To: <joonas.lahtinen@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
rodrigo.vivi@intel.com, airlied@gmail.com
Subject: [Intel-gfx] [PATCH] drm/i915: use sysfs_emit() to instead of scnprintf()
Date: Thu, 1 Dec 2022 10:53:26 +0800 (CST) [thread overview]
Message-ID: <202212011053265568903@zte.com.cn> (raw)
From: ye xingchen <ye.xingchen@zte.com.cn>
Replace the open-code with sysfs_emit() to simplify the code.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
drivers/gpu/drm/i915/i915_mitigations.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_mitigations.c b/drivers/gpu/drm/i915/i915_mitigations.c
index def7302ef7fe..2b7aaaefb3a9 100644
--- a/drivers/gpu/drm/i915/i915_mitigations.c
+++ b/drivers/gpu/drm/i915/i915_mitigations.c
@@ -102,10 +102,10 @@ static int mitigations_get(char *buffer, const struct kernel_param *kp)
bool enable;
if (!local)
- return scnprintf(buffer, PAGE_SIZE, "%s\n", "off");
+ return sysfs_emit(buffer, "%s\n", "off");
if (local & BIT(BITS_PER_LONG - 1)) {
- count = scnprintf(buffer, PAGE_SIZE, "%s,", "auto");
+ count = sysfs_emit(buffer, "%s,", "auto");
enable = false;
} else {
enable = true;
--
2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: <ye.xingchen@zte.com.cn>
To: <joonas.lahtinen@linux.intel.com>
Cc: tvrtko.ursulin@linux.intel.com, intel-gfx@lists.freedesktop.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
rodrigo.vivi@intel.com
Subject: [PATCH] drm/i915: use sysfs_emit() to instead of scnprintf()
Date: Thu, 1 Dec 2022 10:53:26 +0800 (CST) [thread overview]
Message-ID: <202212011053265568903@zte.com.cn> (raw)
From: ye xingchen <ye.xingchen@zte.com.cn>
Replace the open-code with sysfs_emit() to simplify the code.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
drivers/gpu/drm/i915/i915_mitigations.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_mitigations.c b/drivers/gpu/drm/i915/i915_mitigations.c
index def7302ef7fe..2b7aaaefb3a9 100644
--- a/drivers/gpu/drm/i915/i915_mitigations.c
+++ b/drivers/gpu/drm/i915/i915_mitigations.c
@@ -102,10 +102,10 @@ static int mitigations_get(char *buffer, const struct kernel_param *kp)
bool enable;
if (!local)
- return scnprintf(buffer, PAGE_SIZE, "%s\n", "off");
+ return sysfs_emit(buffer, "%s\n", "off");
if (local & BIT(BITS_PER_LONG - 1)) {
- count = scnprintf(buffer, PAGE_SIZE, "%s,", "auto");
+ count = sysfs_emit(buffer, "%s,", "auto");
enable = false;
} else {
enable = true;
--
2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: <ye.xingchen@zte.com.cn>
To: <joonas.lahtinen@linux.intel.com>
Cc: <jani.nikula@linux.intel.com>, <rodrigo.vivi@intel.com>,
<tvrtko.ursulin@linux.intel.com>, <airlied@gmail.com>,
<daniel@ffwll.ch>, <intel-gfx@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] drm/i915: use sysfs_emit() to instead of scnprintf()
Date: Thu, 1 Dec 2022 10:53:26 +0800 (CST) [thread overview]
Message-ID: <202212011053265568903@zte.com.cn> (raw)
From: ye xingchen <ye.xingchen@zte.com.cn>
Replace the open-code with sysfs_emit() to simplify the code.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
drivers/gpu/drm/i915/i915_mitigations.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_mitigations.c b/drivers/gpu/drm/i915/i915_mitigations.c
index def7302ef7fe..2b7aaaefb3a9 100644
--- a/drivers/gpu/drm/i915/i915_mitigations.c
+++ b/drivers/gpu/drm/i915/i915_mitigations.c
@@ -102,10 +102,10 @@ static int mitigations_get(char *buffer, const struct kernel_param *kp)
bool enable;
if (!local)
- return scnprintf(buffer, PAGE_SIZE, "%s\n", "off");
+ return sysfs_emit(buffer, "%s\n", "off");
if (local & BIT(BITS_PER_LONG - 1)) {
- count = scnprintf(buffer, PAGE_SIZE, "%s,", "auto");
+ count = sysfs_emit(buffer, "%s,", "auto");
enable = false;
} else {
enable = true;
--
2.25.1
next reply other threads:[~2022-12-01 15:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 2:53 ye.xingchen [this message]
2022-12-01 2:53 ` [PATCH] drm/i915: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-01 2:53 ` ye.xingchen
2022-12-01 17:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-12-02 5:39 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-12-05 10:50 ` [Intel-gfx] [PATCH] " Jani Nikula
2022-12-05 10:50 ` Jani Nikula
2022-12-05 10:50 ` Jani Nikula
2022-12-06 4:26 ` [Intel-gfx] " Bagas Sanjaya
2022-12-06 4:26 ` Bagas Sanjaya
2022-12-06 4:26 ` Bagas Sanjaya
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=202212011053265568903@zte.com.cn \
--to=ye.xingchen@zte.com.cn \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@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.