Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1860853imu; Thu, 10 Jan 2019 04:22:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN5d9tA2AUQKpJddwSg590h/yb3AhrEVXM2p8k+E7Qfw1ZDTJbsqef2VVGMt1KeJY9HV5UmE X-Received: by 2002:a17:902:c85:: with SMTP id 5mr10307922plt.339.1547122948333; Thu, 10 Jan 2019 04:22:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547122948; cv=none; d=google.com; s=arc-20160816; b=n3M2OoCMluvE/LdM91dyBrsDyvd3Gu9uSXFstbQ/GjhazjA3qN1Wu9cuLpUw+nI1Jl VHsX4JamD4s+asE/UFKsWOOYh8ZjsCKMJa5ehuVc3UdKDpM9TB6u3bcqQZH9nL1qYg83 Ph5IBBXmesyHgLppnxHDYB+wSR2MlmB8Udy5wTGmiWaMXWjAfnLadbsMvlPxI7B3aEBQ YMQoXPLWujP35mN+93qhnw0FeebnR+RjA6Cj0GgtrV1pMS82xv5ZM7kl8kd3u15ls25x ptbiNcUZ1xI3wTWA61Xz63Y9aFct2j1VtmCgtrq3TRV7Zt+56wuFJ46aNR6nNUnQS32I SZ4A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=leTkA6VDWwRI0ED9PAVTtmUEZJGPYfC9CIv59vOBny0=; b=wwnGnaQS2by1jLwMicOspFL/Vmau+FFUofgwoCVKCNm80RsDTookCQ/2UUg/Yr29wF 4wDQioAegAc5G4V4rRmsFDnV8jduvPX4rurX+ZIykIBfSpastzS+uspoa7+CjScp5XVC CQkUgBCpx5cqwT+hMehKechBMTlGMvqtQ5iIZB6bblLWeDX7xSC4gWS+XI49yhr8stp/ W+SCRxaJq6gWXooqiYUr2D//428HM7zqYKiquntXipqRrkIkgY/LkMeG+g0kKuYCjnk3 DiUPfolXfO9Ahdau8kYKY/hpJ1iLJtGog5V+0mxIqAL3b8a12HfnR7FXuRmNdMIlT3o5 v5NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YZuZIIiY; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si2418487pgi.66.2019.01.10.04.22.13; Thu, 10 Jan 2019 04:22:28 -0800 (PST) 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=@linaro.org header.s=google header.b=YZuZIIiY; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728230AbfAJLPo (ORCPT + 99 others); Thu, 10 Jan 2019 06:15:44 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:43405 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727938AbfAJLPn (ORCPT ); Thu, 10 Jan 2019 06:15:43 -0500 Received: by mail-lj1-f195.google.com with SMTP id q2-v6so9314318lji.10 for ; Thu, 10 Jan 2019 03:15:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=leTkA6VDWwRI0ED9PAVTtmUEZJGPYfC9CIv59vOBny0=; b=YZuZIIiYe/b4lEoUc0NoDPsa93vLneqxp1nKl2w6FSJXDHthMAcOhzy9y03FAtYYZ8 3Artv8/bA3mHmz4mlqixshaVryKkbj6I6DcLi/BOQVM0kdT0BGmVpgFKRHAAfsNBUbIY OKlPSBTp+j+XIKhZmdlcOEGjVt0hGgIS6AUG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=leTkA6VDWwRI0ED9PAVTtmUEZJGPYfC9CIv59vOBny0=; b=Qj8L9i9JtxBATlYS5o4JwocD21RYRd8Jn/4TORlvBScC9UEJvdq+F0l0h714RVZJcK ppPe5R8dLw2qNBJMHZI7S977Zu9BHkZrTA3XfFjHfHcPmeXBei9uWX6bfkBg0ZucOy4r feq92k+MglxBlYnyxx3P2limSB40MnHCVQny5RXDZRXvvMZ41VKvIt/2MQJNTDA+tXTZ tNVH6+jXUCJzN8q5b0me8bmsJQ76NQNo7eBCxr37KFTqBAotvHp37E3CUXcTUkf/388e kYmDonuFZr3tAvjnGpxESHo9vdO5QEDQ5eOSklkz507tbVQl7hrvU+ktkyIzKWKN3adq itXw== X-Gm-Message-State: AJcUukffaDwwusrJoNHqcZlWl6HIAOvOpsUIGL51I92yXjbiQo3o0V3Z fpXgdaBBEd2byFSxIcRRbpdjQA== X-Received: by 2002:a05:651c:c8:: with SMTP id 8mr5551057ljr.53.1547118941044; Thu, 10 Jan 2019 03:15:41 -0800 (PST) Received: from localhost (c-573670d5.07-21-73746f28.bbcust.telenor.se. [213.112.54.87]) by smtp.gmail.com with ESMTPSA id i75sm14334658lfb.58.2019.01.10.03.15.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 03:15:40 -0800 (PST) From: Anders Roxell To: vkoul@kernel.org, dan.j.williams@intel.com Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH] dma: ixm-dma: fix warning comparison of distinct pointer types Date: Thu, 10 Jan 2019 12:15:35 +0100 Message-Id: <20190110111535.11235-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 c2fff3f6c9ca..fa3ef43fe314 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -285,7 +285,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.2