From 3351539589054adee6d0b3b9a10227b01f5e4d62 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 3 Jul 2018 20:39:22 -0500 Subject: [PATCH 1/2] [SQUASHME] ASoC: SOF: add mm.h 0-day complains that on some architectures such as m68k mm_struct is not defined. Make sure it's added. In file included from ./arch/m68k/include/asm/pgtable_mm.h:148, from ./arch/m68k/include/asm/pgtable.h:5, from sound/soc/sof/pm.c:15: ./arch/m68k/include/asm/motorola_pgtable.h: In function 'pgd_offset': ./arch/m68k/include/asm/motorola_pgtable.h:199:11: error: dereferencing pointer to incomplete type 'const struct mm_struct' return mm->pgd + pgd_index(address); ^~ In file included from ./arch/m68k/include/asm/pgtable_mm.h:148, from ./arch/m68k/include/asm/pgtable.h:5, from sound/soc/sof/core.c:15: ./arch/m68k/include/asm/motorola_pgtable.h: In function 'pgd_offset': ./arch/m68k/include/asm/motorola_pgtable.h:199:11: error: dereferencing pointer to incomplete type 'const struct mm_struct' return mm->pgd + pgd_index(address); Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/core.c | 1 + sound/soc/sof/pm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index ce315938243a73..de87e8c6766184 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -8,6 +8,7 @@ * Author: Liam Girdwood */ +#include #include #include #include diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index d825ff402fc66a..56c60423e85c84 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -8,6 +8,7 @@ * Author: Liam Girdwood */ +#include #include #include #include From 19adf9cbb7271fcf00aa6c675358a942b7e15575 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 3 Jul 2018 21:00:13 -0500 Subject: [PATCH 2/2] [SQUASHME] ASoC: SOF: ops: fix uninitialized use warning For some architectures/compilers, 0-day reports errors sound/soc/sof/ops.c: In function 'snd_sof_pci_update_bits_unlocked': sound/soc/sof/ops.c:26:6: warning: 'ret' is used uninitialized in this function [-Wuninitialized] u32 ret; ^~~ Fix by forcing value to ~0 (as done in pci_read_config_dword) Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sof/ops.c b/sound/soc/sof/ops.c index a3b1aebb0fd14a..0668f64e1ef672 100644 --- a/sound/soc/sof/ops.c +++ b/sound/soc/sof/ops.c @@ -23,7 +23,7 @@ int snd_sof_pci_update_bits_unlocked(struct snd_sof_dev *sdev, u32 offset, { bool change; unsigned int old, new; - u32 ret; + u32 ret = ~0; /* explicit init to remove uninitialized use warnings */ pci_read_config_dword(sdev->pci, offset, &ret); dev_dbg(sdev->dev, "Debug PCIR: %8.8x at %8.8x\n",