All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: use sysfs_emit() to instead of scnprintf()
@ 2022-12-01  2:24 ` ye.xingchen
  0 siblings, 0 replies; 5+ messages in thread
From: ye.xingchen @ 2022-12-01  2:24 UTC (permalink / raw)
  To: alexander.deucher
  Cc: christian.koenig, xinhui.pan, airlied, daniel, tao.zhou1,
	hawking.zhang, yipeng.chai, john.clements, stanley.yang, amd-gfx,
	dri-devel, linux-kernel

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/amd/amdgpu/amdgpu_ras.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 077404a9c935..ad490c1e2f57 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1267,7 +1267,7 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,
 	struct amdgpu_ras *con =
 		container_of(attr, struct amdgpu_ras, features_attr);

-	return scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
+	return sysfs_emit(buf, "feature mask: 0x%x\n", con->features);
 }

 static void amdgpu_ras_sysfs_remove_bad_page_node(struct amdgpu_device *adev)
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] drm/amdgpu: use sysfs_emit() to instead of scnprintf()
@ 2022-12-01  2:24 ` ye.xingchen
  0 siblings, 0 replies; 5+ messages in thread
From: ye.xingchen @ 2022-12-01  2:24 UTC (permalink / raw)
  To: alexander.deucher
  Cc: xinhui.pan, john.clements, tao.zhou1, linux-kernel, amd-gfx,
	yipeng.chai, stanley.yang, dri-devel, christian.koenig,
	hawking.zhang

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/amd/amdgpu/amdgpu_ras.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 077404a9c935..ad490c1e2f57 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1267,7 +1267,7 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,
 	struct amdgpu_ras *con =
 		container_of(attr, struct amdgpu_ras, features_attr);

-	return scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
+	return sysfs_emit(buf, "feature mask: 0x%x\n", con->features);
 }

 static void amdgpu_ras_sysfs_remove_bad_page_node(struct amdgpu_device *adev)
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] drm/amdgpu: use sysfs_emit() to instead of scnprintf()
@ 2022-12-01  2:24 ` ye.xingchen
  0 siblings, 0 replies; 5+ messages in thread
From: ye.xingchen @ 2022-12-01  2:24 UTC (permalink / raw)
  To: alexander.deucher
  Cc: xinhui.pan, john.clements, tao.zhou1, linux-kernel, amd-gfx,
	yipeng.chai, stanley.yang, dri-devel, daniel, airlied,
	christian.koenig, hawking.zhang

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/amd/amdgpu/amdgpu_ras.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 077404a9c935..ad490c1e2f57 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1267,7 +1267,7 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,
 	struct amdgpu_ras *con =
 		container_of(attr, struct amdgpu_ras, features_attr);

-	return scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
+	return sysfs_emit(buf, "feature mask: 0x%x\n", con->features);
 }

 static void amdgpu_ras_sysfs_remove_bad_page_node(struct amdgpu_device *adev)
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: use sysfs_emit() to instead of scnprintf()
  2022-12-01  2:24 ` ye.xingchen
@ 2022-12-01 16:57   ` Luben Tuikov
  -1 siblings, 0 replies; 5+ messages in thread
From: Luben Tuikov @ 2022-12-01 16:57 UTC (permalink / raw)
  To: ye.xingchen, alexander.deucher
  Cc: xinhui.pan, john.clements, tao.zhou1, linux-kernel, amd-gfx,
	yipeng.chai, stanley.yang, dri-devel, christian.koenig,
	hawking.zhang

Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>

Regards,
Luben

On 2022-11-30 21:24, ye.xingchen@zte.com.cn wrote:
> 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/amd/amdgpu/amdgpu_ras.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 077404a9c935..ad490c1e2f57 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -1267,7 +1267,7 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,
>  	struct amdgpu_ras *con =
>  		container_of(attr, struct amdgpu_ras, features_attr);
> 
> -	return scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
> +	return sysfs_emit(buf, "feature mask: 0x%x\n", con->features);
>  }
> 
>  static void amdgpu_ras_sysfs_remove_bad_page_node(struct amdgpu_device *adev)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: use sysfs_emit() to instead of scnprintf()
@ 2022-12-01 16:57   ` Luben Tuikov
  0 siblings, 0 replies; 5+ messages in thread
From: Luben Tuikov @ 2022-12-01 16:57 UTC (permalink / raw)
  To: ye.xingchen, alexander.deucher
  Cc: xinhui.pan, tao.zhou1, linux-kernel, amd-gfx, yipeng.chai,
	stanley.yang, dri-devel, john.clements, christian.koenig,
	hawking.zhang

Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>

Regards,
Luben

On 2022-11-30 21:24, ye.xingchen@zte.com.cn wrote:
> 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/amd/amdgpu/amdgpu_ras.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 077404a9c935..ad490c1e2f57 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -1267,7 +1267,7 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,
>  	struct amdgpu_ras *con =
>  		container_of(attr, struct amdgpu_ras, features_attr);
> 
> -	return scnprintf(buf, PAGE_SIZE, "feature mask: 0x%x\n", con->features);
> +	return sysfs_emit(buf, "feature mask: 0x%x\n", con->features);
>  }
> 
>  static void amdgpu_ras_sysfs_remove_bad_page_node(struct amdgpu_device *adev)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-01 16:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  2:24 [PATCH] drm/amdgpu: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-01  2:24 ` ye.xingchen
2022-12-01  2:24 ` ye.xingchen
2022-12-01 16:57 ` Luben Tuikov
2022-12-01 16:57   ` Luben Tuikov

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.