All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhen Lei <thunder.leizhen@huawei.com>
To: Mark Brown <broonie@kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>,
	Yanteng Si <siyanteng@loongson.cn>,
	Pratyush Yadav <p.yadav@ti.com>
Subject: [PATCH 1/1] spi: cadence-quadspi: Fix a compilation warning for 64-bit platform
Date: Tue, 12 Jan 2021 18:06:37 +0800	[thread overview]
Message-ID: <20210112100637.747-2-thunder.leizhen@huawei.com> (raw)
In-Reply-To: <20210112100637.747-1-thunder.leizhen@huawei.com>

The __typecheck() requires that the two arguments of max() must be of the
same type. For the current max(), the type of the first parameter "len" is
size_t. But the type of size_t is not fixed, it's "unsigned int" on 32-bit
platforms and "unsigned long" on 64-bit platforms. So both the suffix "U"
and "UL" are not appropriate for the second constant parameter. Therefore,
forcible type conversion is used.

Fixes: 8728a81b8f10 ("spi: Fix distinct pointer types warning for ARCH=mips")
Fixes: 0920a32cf6f2 ("spi: cadence-quadspi: Wait at least 500 ms for direct reads")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/spi/spi-cadence-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 576610ba11184c6..eb40b8d46b56b0c 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1150,7 +1150,7 @@ static int cqspi_direct_read_execute(struct cqspi_flash_pdata *f_pdata,

 	dma_async_issue_pending(cqspi->rx_chan);
 	if (!wait_for_completion_timeout(&cqspi->rx_dma_complete,
-					 msecs_to_jiffies(max(len, 500U)))) {
+				 msecs_to_jiffies(max_t(size_t, len, 500)))) {
 		dmaengine_terminate_sync(cqspi->rx_chan);
 		dev_err(dev, "DMA wait_for_completion_timeout\n");
 		ret = -ETIMEDOUT;
--
1.8.3



  reply	other threads:[~2021-01-12 10:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 10:06 [PATCH 0/1] spi: cadence-quadspi: Fix a compilation warning for 64-bit platform Zhen Lei
2021-01-12 10:06 ` Zhen Lei [this message]
2021-01-12 10:16   ` [PATCH 1/1] " Pratyush Yadav
2021-01-12 11:23     ` Leizhen (ThunderTown)
2021-01-12 12:47 ` [PATCH 0/1] " Mark Brown

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=20210112100637.747-2-thunder.leizhen@huawei.com \
    --to=thunder.leizhen@huawei.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=p.yadav@ti.com \
    --cc=siyanteng@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.