From patchwork Tue Jan 12 10:06:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 361155 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp220156jap; Tue, 12 Jan 2021 02:09:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyr4QunbXQv15ZBE/pb/WkOyo+HuTA6tJF+zN0oumzymkby0/Pb1SB+ia75nRQakifEZYyx X-Received: by 2002:a05:6402:19b0:: with SMTP id o16mr2772827edz.270.1610446143605; Tue, 12 Jan 2021 02:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610446143; cv=none; d=google.com; s=arc-20160816; b=g9sSl9epmbVlBEm00w7JKVUDKCkyyAg/v7LONT8XFuwwrv5WKhqLBPRU7p2OUMdire XhlgeeWTWWWW2zTxuwwaJU0u8nOfI9JD4+vGHXrv5kJqobDQjlHEGy6NpIGNikXrnfqI 1TwtPqcxWi8e/W6EOhrnOJZvaX+CFLmirbKmrwlXx99Q8n2MemqYM65FORJCiksZD1ek pToBZ1XEBTo9rjV1MuuaBvwL/XLKvauS43bkWSejTgtu7sEay/rAB3yjuzEVIiaDPYQH mVqVIO/fk3faP/639IKg88RAFRHEGx55AxwFOFM2Bh5zIDV/fz5mBPubZstDr9vFHKZl aJsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=3QEHhDsXQpLWyRRnHGm7XQA4ycmtAyDSMuUktHK37CI=; b=LR8ja9m5hqeZDp1ppz5RiC7vajYNuECgnSNo5+KUgs+dfgd3jQYMG/gfw2eImVZdpu Un9u3HGCGQbItt/EgaaBPneFxYdTotG12D1A9Vdzwqz9gg6J9+GLlHuw+pa2PITkPEYV mOODwK3od27EFcaZe2YkT6v0G2Vt64odofj8KcgtAE0wk8njgaPVsB75kK7gC1skPEfE 8zx5p1drN6Ox85z/nvPaoMG1H8vp56TodHeOieU70KN+2FogTeT5uQ5s6PhVjq1OaLWb +FzZD46S5zgfAROD+wwliGboIKYmlFM+gvCuVvl291UoR5BQRqqNYtxkgytFuXBCX3I+ LMrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-spi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si1109402edr.313.2021.01.12.02.09.03; Tue, 12 Jan 2021 02:09:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-spi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-spi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390409AbhALKHl (ORCPT + 1 other); Tue, 12 Jan 2021 05:07:41 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:10958 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbhALKHl (ORCPT ); Tue, 12 Jan 2021 05:07:41 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DFR6q1dkgzj5Pf; Tue, 12 Jan 2021 18:06:11 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.176.220) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Tue, 12 Jan 2021 18:06:49 +0800 From: Zhen Lei To: Mark Brown , linux-spi , linux-kernel CC: Zhen Lei , Yanteng Si , Pratyush Yadav Subject: [PATCH 1/1] spi: cadence-quadspi: Fix a compilation warning for 64-bit platform Date: Tue, 12 Jan 2021 18:06:37 +0800 Message-ID: <20210112100637.747-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210112100637.747-1-thunder.leizhen@huawei.com> References: <20210112100637.747-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.176.220] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org 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 --- drivers/spi/spi-cadence-quadspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.3 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;