Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5613037img; Wed, 27 Mar 2019 11:42:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkxR0m/FheAiZ3z0zsbsSfoZ1dgT4W6Yx0GQ9+gU0jlfd+y1aaVWPCq4wV2YXNhyRWclsk X-Received: by 2002:a65:64d5:: with SMTP id t21mr35018239pgv.266.1553712178786; Wed, 27 Mar 2019 11:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712178; cv=none; d=google.com; s=arc-20160816; b=mI0+ADEFpieJ7FWOar099Vg1L7l0qi8klh+NqSkDCjSDobwVT77TWGjE6ebyjRN++J BxpserceOQODkp/HF79LL3D0pfuVvJu1IkB0zeV6Z0N3MITQFwxDXRS2WyOApejX6b3b fAOPCLBPjsJ08gJdASCY7mIesOcRHMHru9uz2M26rwU7RreF26lqxujpJO60YFKQCPhS yJUTlkxXCh9Zj/18fN1YzHid1uRjyduqU+GS2mwBkA14N3UR7Aip2oBnUxRB6R1JmNTr T9d2OXP85EcX9H2dHxLdKqSJeEtjNVxqilV9QKIQl7A5yXWCWSM10IrQozkszeOmOrZx DaeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ojSeAAivwNrQlXBhEDrnddXkyJn56GqlUjhne+wSNF4=; b=MXE7m8p9t1SlRJMWWz1li3D47XKk4HqK/vPxhxMq4W/7xET4aJK8RT/Tl40CeQJ1aS gFrF5jbsl5CtdvE/u/Z6d/O2EPkvNO5nTSWpEDz7nSxb/FcI1Ewknr7k0B8/fvGVkE+f 1B6LeLF3YJfYGlYOoahbfhiAAx8JMj8XxTIMfosOnKrA2jEQp/C4hiQFwtTZ8nScjPU5 1f0h4pYchrWeBdVlsXqnaLMc+1pMPFeRAgFEA9FMkakf/VW8MnY+HMtHksPbHY4v6Hr2 FtY8EjFvvcmD17hekLMiLr67fJxzt+q26ZtJWAaoU9ejMbsUyVC5Y/ucy3aBOWtd6wAY vVGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QAineV4R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21si10543183plr.366.2019.03.27.11.42.43; Wed, 27 Mar 2019 11:42:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QAineV4R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391449AbfC0Sjy (ORCPT + 99 others); Wed, 27 Mar 2019 14:39:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:41244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391384AbfC0SXB (ORCPT ); Wed, 27 Mar 2019 14:23:01 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D782620449; Wed, 27 Mar 2019 18:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710980; bh=9+VbxPXqyVaC6ds4kj39egbF6cyIe1wtvhs2xjsi1Eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QAineV4R2Wufaktbx5HE89IwBSjBzFn9eAgcoN5GJzm6vmwE3r88h/YPsyNveSL3I esY+Z28b8FNtwE4mZ7JQs2BLiVKXhImUvTrbP2G3WaN1QTWVMxO/cxl5CsiBOuhBJS 9Oqbjc296d9ltftam4xe4zyEMwaGPVeDlS+gAnfc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Anders Roxell , Vinod Koul , Sasha Levin , dmaengine@vger.kernel.org Subject: [PATCH AUTOSEL 4.9 75/87] dmaengine: imx-dma: fix warning comparison of distinct pointer types Date: Wed, 27 Mar 2019 14:20:28 -0400 Message-Id: <20190327182040.17444-75-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anders Roxell [ Upstream commit 9227ab5643cb8350449502dd9e3168a873ab0e3b ] The warning got introduced by commit 930507c18304 ("arm64: add basic Kconfig symbols for i.MX8"). Since it got enabled for arm64. The warning haven't been seen before since size_t was 'unsigned int' when built on arm32. ../drivers/dma/imx-dma.c: In function ‘imxdma_sg_next’: ../include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ^~ ../include/linux/kernel.h:860:4: note: in expansion of macro ‘__typecheck’ (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~ ../include/linux/kernel.h:870:24: note: in expansion of macro ‘__safe_cmp’ __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~ ../include/linux/kernel.h:879:19: note: in expansion of macro ‘__careful_cmp’ #define min(x, y) __careful_cmp(x, y, <) ^~~~~~~~~~~~~ ../drivers/dma/imx-dma.c:288:8: note: in expansion of macro ‘min’ now = min(d->len, sg_dma_len(sg)); ^~~ Rework so that we use min_t and pass in the size_t that returns the minimum of two values, using the specified type. Signed-off-by: Anders Roxell Acked-by: Olof Johansson Reviewed-by: Fabio Estevam Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/imx-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 1cfa1d9bc971..f8786f60cdc1 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -290,7 +290,7 @@ static inline int imxdma_sg_next(struct imxdma_desc *d) struct scatterlist *sg = d->sg; unsigned long now; - now = min(d->len, sg_dma_len(sg)); + now = min_t(size_t, d->len, sg_dma_len(sg)); if (d->len != IMX_DMA_LENGTH_LOOP) d->len -= now; -- 2.19.1