From: Vinod Koul <vkoul@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: kernel test robot <lkp@intel.com>,
Sugar Zhang <sugar.zhang@rock-chips.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: Re: drivers/dma/pl330.c:2981:9: warning: Identical condition 'ret', second condition is always false
Date: Mon, 24 Aug 2020 19:24:38 +0530 [thread overview]
Message-ID: <20200824135438.GA2639@vkoul-mobl> (raw)
In-Reply-To: <9e7612e8-41a5-460d-5492-12c5ef81b914@samsung.com>
On 24-08-20, 15:50, Marek Szyprowski wrote:
> Hi Vinod,
>
> On 08.08.2020 14:59, Vinod Koul wrote:
> > On 08-08-20, 10:53, kernel test robot wrote:
> >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >> head: 30185b69a2d533c4ba6ca926b8390ce7de495e29
> >> commit: a39cddc9e3775100100a4272feed64faac831be9 dmaengine: pl330: Drop boilerplate code for suspend/resume
> >> date: 8 months ago
> >> compiler: aarch64-linux-gcc (GCC) 9.3.0
> >>
> >> If you fix the issue, kindly add following tag as appropriate
> >> Reported-by: kernel test robot <lkp@intel.com>
> >>
> >>
> >> cppcheck warnings: (new ones prefixed by >>)
> >>
> >>>> drivers/dma/pl330.c:2981:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
> >> return ret;
> >> ^
> >> drivers/dma/pl330.c:2976:6: note: first condition
> >> if (ret)
> >> ^
> >> drivers/dma/pl330.c:2981:9: note: second condition
> >> return ret;
> > This one could be fixed by making this as return 0, but is harmless
>
> Right, with CONFIG_PM disabled, pm_runtime_force_resume() is noop, what
> causes the above warning.
>
> >> ^
> >>>> drivers/dma/pl330.c:2798:23: warning: Variable 'desc->rqcfg.brst_len' is reassigned a value before the old one has been used. [redundantAssignment]
> >> desc->rqcfg.brst_len = get_burst_len(desc, len);
> >> ^
> >> drivers/dma/pl330.c:2796:24: note: Variable 'desc->rqcfg.brst_len' is reassigned a value before the old one has been used.
> >> desc->rqcfg.brst_len = 1;
> >> ^
> >> drivers/dma/pl330.c:2798:23: note: Variable 'desc->rqcfg.brst_len' is reassigned a value before the old one has been used.
> >> desc->rqcfg.brst_len = get_burst_len(desc, len);
> > This one actually seems like a bug. Reading the code I think
> > get_burst_len() should be called first before checking if burst size is
> > smaller and setting to 1 in that case
> >
> > Sugar Zhang, Marek Szyprowski can you folks check this?
>
> Indeed. It look that the commit 137bd11090d89b added
> desc->rqcfg.brst_len = 1 assignment before the desc->rqcfg.brst_len is
> set. Maybe this was a result of the broken rebase or so. No idea. It
> makes sense to switch the order and call desc->rqcfg.brst_len =
> get_burst_len(desc, len) first. I can send a patch if you want.
That would be great Marek
Thanks
--
~Vinod
prev parent reply other threads:[~2020-08-24 13:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-08 2:53 kernel test robot
2020-08-08 12:59 ` Vinod Koul
2020-08-24 13:50 ` Marek Szyprowski
2020-08-24 13:54 ` Vinod Koul [this message]
Reply instructions:
You may reply publicly 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=20200824135438.GA2639@vkoul-mobl \
--to=vkoul@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=m.szyprowski@samsung.com \
--cc=sugar.zhang@rock-chips.com \
--cc=ulf.hansson@linaro.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®