Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1000656yba; Thu, 4 Apr 2019 02:07:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+EPsck7HjThBo6x3vRP3m3tEABQExbYQ4qjCMkVzK9elxO5z508/2/xQC0nz8tGDxormA X-Received: by 2002:a65:6659:: with SMTP id z25mr4533610pgv.10.1554368862334; Thu, 04 Apr 2019 02:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368862; cv=none; d=google.com; s=arc-20160816; b=pSP6y984bKcBNPiqzDKkETQd637/cEuGkMDJS+GWOt/f5fE2Np1ygVZd+pFAtpL1Xz j6OHASdXsqNeZG3Gt8yeMY63qD2oumh17lZePagO6vqQWA4uB86sTen52GPEhmaS9Ajp kaz9UGcUGAIbGAgBEg/AP5LbKj1g1Xi0t8HUsnHWOT67nFmltKnDJlg+oqDQQmr5FAyw VWnSdL1moxBDrY0hQPOceSjPcAiR7fTlYDgBGKuRBFSpbsyX6mj9W9qYrHW3vmJOTueQ iejkNeks35CzrTomYpkoK4hJ+CTjO47x3MzXhqf7J86AuYaiLFzb6KvLQpfLmELNcpu5 2fpw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oVF86iTV0+XL8UebwkUB2lbfjFs9dSMDX642jHk7zy8=; b=zEw7U9vkECmWRQT0VKg1nEZiAUeFPE+Pq8ZMcyYMUJ0/eym/JL3JOA9JTsDI9INlqa P4p1esFz8vEJ3CTUsoXJHLI3xLPHLNYtHnz5fSWtNJqhyrPyA+p3666w36JQwZP69A6/ H4Z9q9u1UseFYbNi5dRy5Qi9Omp2ZNsKmC2XaOgeyL5A3Dl4k98QIbn7zbcz+CYnukjf xD20TVhO+14jlmQ15Tm+SWTh6T84g3sTCkKk1IzixiS3Zg9XFaUP6ZmlFxe0djYpTWCP 9QvYEct7mi9Fa8rSJuZmiLxbSJqMB53aJ0oBd1LcRu6C4vTJqvxVCe+nPKB97BD//Hld Fu1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E6fjkgay; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si10189510pga.205.2019.04.04.02.07.27; Thu, 04 Apr 2019 02:07:42 -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=E6fjkgay; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732413AbfDDJGy (ORCPT + 99 others); Thu, 4 Apr 2019 05:06:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:45540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732402AbfDDJGw (ORCPT ); Thu, 4 Apr 2019 05:06:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6EBB82183E; Thu, 4 Apr 2019 09:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368811; bh=FlBlzyasrriqhXxgp7kHoVtI6UPZlhGw3sdH2B2la7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E6fjkgayxNsKGu4MrozVIOhW+n01KMAI+LBX0GkqbXTjCZn5aeQsDDFL73vI9yX3/ iWsjAKupTKGy28J16qW8th6xhkhSfUhb/hEMEESktIrGC4azOwHcEDmxpoMcSxXhn/ 4gSw4pvjxOICJTPoY+XT3m/JGAFGtJDqKOCXvP8U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anders Roxell , Olof Johansson , Fabio Estevam , Vinod Koul , Sasha Levin Subject: [PATCH 4.19 163/187] dmaengine: imx-dma: fix warning comparison of distinct pointer types Date: Thu, 4 Apr 2019 10:48:20 +0200 Message-Id: <20190404084610.779298535@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 118d371a2a4a..dfee0d895ce3 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -284,7 +284,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