dmaengine Archive on lore.kernel.org
 help / color / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Vinod Koul <vkoul@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	dmaengine@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] dma: ste_dma40: fix unneeded variable warning
Date: Fri, 12 Jul 2019 12:16:48 -0700
Message-ID: <CAKwvOd=-OE=uHCurw7VsHPUVHz9XWW7U_8vJEerGaYPii+f8RQ@mail.gmail.com> (raw)
In-Reply-To: <20190712173912.GA127917@archlinux-threadripper>

On Fri, Jul 12, 2019 at 10:39 AM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Fri, Jul 12, 2019 at 11:13:30AM +0200, Arnd Bergmann wrote:
> > 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>

Thanks for the patch!

>
> Might be worth mentioning that this warning will only appear when
> CONFIG_PM is unset (they are both used in d40_save_restore_registers).

So would moving the definition into a
#ifdef CONFIG_PM
#endif
block be better than __maybe_unused?

-- 
Thanks,
~Nick Desaulniers

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  9:13 Arnd Bergmann
2019-07-12 17:39 ` Nathan Chancellor
2019-07-12 19:16   ` Nick Desaulniers [this message]
2019-07-12 20:32     ` Arnd Bergmann

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKwvOd=-OE=uHCurw7VsHPUVHz9XWW7U_8vJEerGaYPii+f8RQ@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org dmaengine@archiver.kernel.org
	public-inbox-index dmaengine


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/ public-inbox