* [PATCH] ASoC: SOF: Disable pointless writes to debugfs file
@ 2024-04-04 7:38 Dan Carpenter
2024-04-04 14:50 ` Péter Ujfalusi
2024-04-04 16:58 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-04-04 7:38 UTC (permalink / raw)
To: Pierre-Louis Bossart
Cc: Liam Girdwood, Peter Ujfalusi, Bard Liao, Ranjani Sridharan,
Daniel Baluta, Kai Vehmanen, Mark Brown, Jaroslav Kysela,
Takashi Iwai, sound-open-firmware, linux-sound, linux-kernel,
kernel-janitors
The permissions on this debugfs file are 0444 so it can't be written to.
And writing to the file hasn't done anything since commit 6e9548cdb30e
("ASoC: SOF: Convert the generic IPC flood test into SOF client").
Delete the write function.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
I haven't tested this patch and there is a risk that it breaks some of
the test scripts. Another option would be to just make it a dummy
function that does { return count; }. But I thought I would try the
better option first.
Please review this extra carefully.
sound/soc/sof/debug.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
index 7c8aafca8fde..937e51b02a24 100644
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -19,24 +19,6 @@
#include "sof-priv.h"
#include "ops.h"
-static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
- size_t count, loff_t *ppos)
-{
- size_t size;
- char *string;
- int ret;
-
- string = kzalloc(count+1, GFP_KERNEL);
- if (!string)
- return -ENOMEM;
-
- size = simple_write_to_buffer(string, count, ppos, buffer, count);
- ret = size;
-
- kfree(string);
- return ret;
-}
-
static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos)
{
@@ -126,7 +108,6 @@ static const struct file_operations sof_dfs_fops = {
.open = simple_open,
.read = sof_dfsentry_read,
.llseek = default_llseek,
- .write = sof_dfsentry_write,
};
/* create FS entry for debug files that can expose DSP memories, registers */
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: SOF: Disable pointless writes to debugfs file
2024-04-04 7:38 [PATCH] ASoC: SOF: Disable pointless writes to debugfs file Dan Carpenter
@ 2024-04-04 14:50 ` Péter Ujfalusi
2024-04-04 16:58 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Péter Ujfalusi @ 2024-04-04 14:50 UTC (permalink / raw)
To: Dan Carpenter, Pierre-Louis Bossart
Cc: Liam Girdwood, Bard Liao, Ranjani Sridharan, Daniel Baluta,
Kai Vehmanen, Mark Brown, Jaroslav Kysela, Takashi Iwai,
sound-open-firmware, linux-sound, linux-kernel, kernel-janitors
On 04/04/2024 10:38, Dan Carpenter wrote:
> The permissions on this debugfs file are 0444 so it can't be written to.
> And writing to the file hasn't done anything since commit 6e9548cdb30e
> ("ASoC: SOF: Convert the generic IPC flood test into SOF client").
> Delete the write function.
I agree, it is not used anymore and ...
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> ---
> I haven't tested this patch and there is a risk that it breaks some of
> the test scripts. Another option would be to just make it a dummy
> function that does { return count; }. But I thought I would try the
> better option first.
>
> Please review this extra carefully.
>
> sound/soc/sof/debug.c | 19 -------------------
> 1 file changed, 19 deletions(-)
>
> diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
> index 7c8aafca8fde..937e51b02a24 100644
> --- a/sound/soc/sof/debug.c
> +++ b/sound/soc/sof/debug.c
> @@ -19,24 +19,6 @@
> #include "sof-priv.h"
> #include "ops.h"
>
> -static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
> - size_t count, loff_t *ppos)
> -{
> - size_t size;
> - char *string;
> - int ret;
> -
> - string = kzalloc(count+1, GFP_KERNEL);
> - if (!string)
> - return -ENOMEM;
> -
> - size = simple_write_to_buffer(string, count, ppos, buffer, count);
> - ret = size;
> -
> - kfree(string);
This was not too constructive ;)
> - return ret;
> -}
> -
> static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
> size_t count, loff_t *ppos)
> {
> @@ -126,7 +108,6 @@ static const struct file_operations sof_dfs_fops = {
> .open = simple_open,
> .read = sof_dfsentry_read,
> .llseek = default_llseek,
> - .write = sof_dfsentry_write,
> };
>
> /* create FS entry for debug files that can expose DSP memories, registers */
--
Péter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: SOF: Disable pointless writes to debugfs file
2024-04-04 7:38 [PATCH] ASoC: SOF: Disable pointless writes to debugfs file Dan Carpenter
2024-04-04 14:50 ` Péter Ujfalusi
@ 2024-04-04 16:58 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-04-04 16:58 UTC (permalink / raw)
To: Pierre-Louis Bossart, Dan Carpenter
Cc: Liam Girdwood, Peter Ujfalusi, Bard Liao, Ranjani Sridharan,
Daniel Baluta, Kai Vehmanen, Jaroslav Kysela, Takashi Iwai,
sound-open-firmware, linux-sound, linux-kernel, kernel-janitors
On Thu, 04 Apr 2024 10:38:45 +0300, Dan Carpenter wrote:
> The permissions on this debugfs file are 0444 so it can't be written to.
> And writing to the file hasn't done anything since commit 6e9548cdb30e
> ("ASoC: SOF: Convert the generic IPC flood test into SOF client").
> Delete the write function.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: Disable pointless writes to debugfs file
commit: 84ae7d9cfa5f6ec284efccedcb7baf7c075774d4
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-04 16:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-04 7:38 [PATCH] ASoC: SOF: Disable pointless writes to debugfs file Dan Carpenter
2024-04-04 14:50 ` Péter Ujfalusi
2024-04-04 16:58 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®