From patchwork Thu Jan 10 11:15:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 155131 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1771035jaa; Thu, 10 Jan 2019 03:15:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN65rTAnw6Pcopz7S+OrlFbBgTydjVzl1CE1XjnC/8yB6HqqIyOYWEFwIWWHEHKvtLF1WYHh X-Received: by 2002:a63:dc0c:: with SMTP id s12mr9128677pgg.398.1547118944051; Thu, 10 Jan 2019 03:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547118944; cv=none; d=google.com; s=arc-20160816; b=eIGwH4T2x3LyemnZ4Bqe3cKckZ3Vw0cXXYxf+5CfKzeJDuWk5EA0TFPgXoCkypD7pv 7cPO0QG6WWTCZo1Wd3niPS6Cu/3J5+0L1VKeopy/VeKcG0ddIB20DFoskF9Ik6LFvV4o 1suQ0UKx7wamUC7Xp3qQPR/0XhCHHKv6fPrM0l3CN+r0AiVjNy1nVY45y6gMfHSBF7j0 jfHlRj70O+va+e8BzwdAc7OjQUfeq8nT/EllChlbK4KdR8bS7fJC7Lp4hinp9a6WRg1n RBvoR1Otc2b/9lrPAPRFJCJjfpY/keVs3X9m4223N009tIsNGAEoDYdw1jvVgonKH3tC ruCQ== 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=qK9IUE6ta8IrgBjSkd257/CIXW5cnJA/Jzh25/E/J3hd7fjqtuM4vMADEU2HG7MTm8 eRwqhHs1p6Cse3M0Nc0X1IhKJ2ua9F5Bf13gwQXutrV4MqWpSVB8Jfqhq7peBDVYN5Yx GUhl8JFMzTIN38rirProdTJ38TKt04ILSf1j8p00MkX0EMWOoQHJYcpDP1fT7hvP44dP mzM7kx2z2kvRibPalPVqPCVE0C+WKKKh32LQMqACmb4MNsM8G5RXjnN6TpCFPK2VfH0P joX6QMJOhBi2+A3LoiCQZqBZukrQJufzeCVyQzbl5h091BS0apuCU22LB6jMb4sLDFJ8 RaBw== 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 dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-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 59si16256025ple.291.2019.01.10.03.15.43; Thu, 10 Jan 2019 03:15:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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 dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-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 S1727975AbfAJLPn (ORCPT + 3 others); Thu, 10 Jan 2019 06:15:43 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:39599 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727958AbfAJLPn (ORCPT ); Thu, 10 Jan 2019 06:15:43 -0500 Received: by mail-lj1-f196.google.com with SMTP id t9-v6so9353002ljh.6 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=pf1xFQcNCM5Frn/RiWAhsmTa9Vo8s2AxtrwNCdzTV/pewcPsYrm/+Okg0J4AIAGEy4 iwmgZQ5fwyaeZSY25GK5f9ixO27DAOtUtM+UAnngmvGbDMD7fVbxjTj8fuhdt3gq7f7t dG/06NR8TrLVafdPbMRjQi9fDQQBe22NUKkCHek01dycdOPxcqLdkxogFDp1F13UthY/ Ll1OiIrbSXipVTxmvrx66HWy5WUswUgXULPmoAO0JF9HewCXmNiwsX+nNVjell5X8xQr 96fk75E+5DAAw72byDaqv/9fp5egnXtXeMBgO1EOZCLWDyNjhXkNlR9iGbZAVnDkNFSi 9eXw== X-Gm-Message-State: AJcUukc1q3zIyqbxGPijaZ0Or0oPb41VxM1UaWsfkzKgyI+jX1qr+br9 Ns0xUbIkY6/JmomNC+fVppUgLw== 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 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@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(-) -- 2.19.2 Acked-by: Olof Johansson Reviewed-by: Fabio Estevam 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;