Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: ste_dma40: fix unneeded variable warning

clang-9 points out that there are two variables that depending on the
configuration may only be used in an ARRAY_SIZE() expression but not
referenced:

drivers/dma/ste_dma40.c:145:12: error: variable 'd40_backup_regs' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static u32 d40_backup_regs[] = {
^
drivers/dma/ste_dma40.c:214:12: error: variable 'd40_backup_regs_chan' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static u32 d40_backup_regs_chan[] = {

Mark these __maybe_unused to shut up the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20190712091357.744515-1-arnd@arndb.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Arnd Bergmann and committed by
Vinod Koul
5d6fb560 6f4722b1

+2 -2
+2 -2
drivers/dma/ste_dma40.c
··· 142 142 * when the DMA hw is powered off. 143 143 * TODO: Add save/restore of D40_DREG_GCC on dma40 v3 or later, if that works. 144 144 */ 145 - static u32 d40_backup_regs[] = { 145 + static __maybe_unused u32 d40_backup_regs[] = { 146 146 D40_DREG_LCPA, 147 147 D40_DREG_LCLA, 148 148 D40_DREG_PRMSE, ··· 211 211 212 212 #define BACKUP_REGS_SZ_V4B ARRAY_SIZE(d40_backup_regs_v4b) 213 213 214 - static u32 d40_backup_regs_chan[] = { 214 + static __maybe_unused u32 d40_backup_regs_chan[] = { 215 215 D40_CHAN_REG_SSCFG, 216 216 D40_CHAN_REG_SSELT, 217 217 D40_CHAN_REG_SSPTR,