DMA Engine development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Binbin Zhou <zhoubinbin@loongson.cn>
Cc: dmaengine@vger.kernel.org
Subject: [bug report] dmaengine: ls2x-apb: New driver for the Loongson LS2X APB DMA controller
Date: Fri, 25 Oct 2024 11:59:59 +0300	[thread overview]
Message-ID: <87cdc025-7246-4548-85ca-3d36fdc2be2d@stanley.mountain> (raw)

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()?

    190         val |= LDMA_64BIT_EN | cmd;
    191         lo_hi_writeq(val, priv->regs + LDMA_ORDER_ERG);
    192 }

regards,
dan carpenter

             reply	other threads:[~2024-10-25  9:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25  8:59 Dan Carpenter [this message]
2024-10-28  2:40 ` [bug report] dmaengine: ls2x-apb: New driver for the Loongson LS2X APB DMA controller Binbin Zhou

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=87cdc025-7246-4548-85ca-3d36fdc2be2d@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=zhoubinbin@loongson.cn \
    /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