linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] remoteproc: sysfs: Use sysfs_emit instead of sprintf
@ 2021-03-03 21:47 Siddharth Gupta
  2021-03-11 23:32 ` patchwork-bot+linux-remoteproc
  0 siblings, 1 reply; 2+ messages in thread
From: Siddharth Gupta @ 2021-03-03 21:47 UTC (permalink / raw)
  To: ohad, bjorn.andersson, linux-remoteproc, linux-kernel
  Cc: Raghavendra Rao Ananta, Siddharth Gupta

From: Raghavendra Rao Ananta <rananta@codeaurora.org>

For security reasons sysfs_emit() is preferred over sprintf().
Hence, convert the remoteproc's sysfs show functions accordingly.

Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
---
 drivers/remoteproc/remoteproc_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c
index 1dbef89..6840dad 100644
--- a/drivers/remoteproc/remoteproc_sysfs.c
+++ b/drivers/remoteproc/remoteproc_sysfs.c
@@ -15,7 +15,7 @@ static ssize_t recovery_show(struct device *dev,
 {
 	struct rproc *rproc = to_rproc(dev);
 
-	return sprintf(buf, "%s", rproc->recovery_disabled ? "disabled\n" : "enabled\n");
+	return sysfs_emit(buf, "%s", rproc->recovery_disabled ? "disabled\n" : "enabled\n");
 }
 
 /*
@@ -82,7 +82,7 @@ static ssize_t coredump_show(struct device *dev,
 {
 	struct rproc *rproc = to_rproc(dev);
 
-	return sprintf(buf, "%s\n", rproc_coredump_str[rproc->dump_conf]);
+	return sysfs_emit(buf, "%s\n", rproc_coredump_str[rproc->dump_conf]);
 }
 
 /*
-- 
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* Re: [PATCH v2] remoteproc: sysfs: Use sysfs_emit instead of sprintf
  2021-03-03 21:47 [PATCH v2] remoteproc: sysfs: Use sysfs_emit instead of sprintf Siddharth Gupta
@ 2021-03-11 23:32 ` patchwork-bot+linux-remoteproc
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2021-03-11 23:32 UTC (permalink / raw)
  To: Siddharth Gupta; +Cc: linux-remoteproc

Hello:

This patch was applied to andersson/remoteproc.git (refs/heads/for-next):

On Wed,  3 Mar 2021 13:47:02 -0800 you wrote:
> From: Raghavendra Rao Ananta <rananta@codeaurora.org>
> 
> For security reasons sysfs_emit() is preferred over sprintf().
> Hence, convert the remoteproc's sysfs show functions accordingly.
> 
> Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
> 
> [...]

Here is the summary with links:
  - [v2] remoteproc: sysfs: Use sysfs_emit instead of sprintf
    https://git.kernel.org/andersson/remoteproc/c/145e1da374bc

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-03-11 23:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 21:47 [PATCH v2] remoteproc: sysfs: Use sysfs_emit instead of sprintf Siddharth Gupta
2021-03-11 23:32 ` patchwork-bot+linux-remoteproc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).