From: Binbin Zhou <zhoubinbin@loongson.cn>
To: Dan Carpenter <dan.carpenter@linaro.org>,
Huacai Chen <chenhuacai@loongson.cn>,
Huacai Chen <chenhuacai@kernel.org>,
zhoubb.aaron@gmail.com
Cc: dmaengine@vger.kernel.org
Subject: Re: [bug report] dmaengine: ls2x-apb: New driver for the Loongson LS2X APB DMA controller
Date: Mon, 28 Oct 2024 10:40:10 +0800 [thread overview]
Message-ID: <89738377-d752-4d23-8fe9-928dd4e3440f@loongson.cn> (raw)
In-Reply-To: <87cdc025-7246-4548-85ca-3d36fdc2be2d@stanley.mountain>
Hi Dan:
Thanks for your report.
On 2024/10/25 16:59, Dan Carpenter wrote:
> Hello Binbin Zhou,
>
> Commit 71e7d3cb6e55 ("dmaengine: ls2x-apb: New driver for the
> Loongson LS2X APB DMA controller") from Dec 18, 2023 (linux-next),
> leads to the following Smatch static checker warning:
>
> drivers/dma/loongson2-apb-dma.c:189 ls2x_dma_write_cmd()
> warn: was expecting a 64 bit value instead of '~(((0)) + (((~((0))) - (((1)) << (0)) + 1) & (~((0)) >> ((8 * 4) - 1 - (4)))))'
>
> drivers/dma/loongson2-apb-dma.c
> 184 static void ls2x_dma_write_cmd(struct ls2x_dma_chan *lchan, bool cmd)
> 185 {
> 186 struct ls2x_dma_priv *priv = to_ldma_priv(lchan->vchan.chan.device);
> 187 u64 val;
> 188
> --> 189 val = lo_hi_readq(priv->regs + LDMA_ORDER_ERG) & ~LDMA_CONFIG_MASK;
>
> On a 32bit build the ~LDMA_CONFIG_MASK will zero out the high 32 bits. Should
> LDMA_CONFIG_MASK be defined with GENMASK_ULL()?
Indeed, it is more appropriate to define it as GENMASK_ULL().
I'll submit a patch to redefine it.
Thanks.
Binbin
>
> 190 val |= LDMA_64BIT_EN | cmd;
> 191 lo_hi_writeq(val, priv->regs + LDMA_ORDER_ERG);
> 192 }
>
> regards,
> dan carpenter
prev parent reply other threads:[~2024-10-28 2:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 8:59 [bug report] dmaengine: ls2x-apb: New driver for the Loongson LS2X APB DMA controller Dan Carpenter
2024-10-28 2:40 ` Binbin Zhou [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=89738377-d752-4d23-8fe9-928dd4e3440f@loongson.cn \
--to=zhoubinbin@loongson.cn \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=dan.carpenter@linaro.org \
--cc=dmaengine@vger.kernel.org \
--cc=zhoubb.aaron@gmail.com \
/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