Skip to contentSkip to conversation

ASoC: sof: Fix warning when IPC flood test is not enabled

PATCH In review Mark Brown 2 participants 2 messages Aug 8, 2019

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/1 ASoC: sof: Fix warning when IPC flood test is not enabled

dentry is only used when the flood test is done so move the declaration of the variable inside the ifdef for the flood test.

---
 sound/soc/sof/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/sof/debug.c +2 -1
index 40940b2fe9d5..54cd431faab7 100644
@@ -221,7 +221,6 @@ static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
 {
 	struct snd_sof_dfsentry *dfse = file->private_data;
 	struct snd_sof_dev *sdev = dfse->sdev;
-	struct dentry *dentry;
 	loff_t pos = *ppos;
 	size_t size_ret;
 	int skip = 0;
@@ -229,6 +228,8 @@ static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
 	u8 *buf;
 
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST)
+	struct dentry *dentry;
+
 	dentry = file->f_path.dentry;
 	if ((!strcmp(dentry->d_name.name, "ipc_flood_count") ||
 	     !strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) &&
Signature · 1 line
2.20.1
Reviewed-by Ranjani Sridharan on v1 1/1
#1 lore raw
Quoted 5 lines · Mark Brown

dentry is only used when the flood test is done so move the declaration of the variable inside the ifdef for the flood test.

Looks good, thanks, Mark.

Quoted 35 lines
---
 sound/soc/sof/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/sof/debug.c +0 -1
index 40940b2fe9d5..54cd431faab7 100644
@@ -221,7 +221,6 @@ static ssize_t sof_dfsentry_read(struct file *file,
 char __user *buffer,
 {
        struct snd_sof_dfsentry *dfse = file->private_data;
        struct snd_sof_dev *sdev = dfse->sdev;
-       struct dentry *dentry;
        loff_t pos = *ppos;
        size_t size_ret;
        int skip = 0;
sound/soc/sof/debug.c +2 -0
@@ -229,6 +228,8 @@ static ssize_t sof_dfsentry_read(struct file *file,
 char __user *buffer,
        u8 *buf;
 
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST)
+       struct dentry *dentry;
+
        dentry = file->f_path.dentry;
        if ((!strcmp(dentry->d_name.name, "ipc_flood_count") ||
             !strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) &&

--
2.20.1

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel