Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2878401imu; Sun, 13 Jan 2019 12:15:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN6eF1scRR4IV/LfkPzJ/HLaPq4V2OCrOGlsuaPcm4LMsxngmXJ3e2HYs0xDDwEoCcll87u8 X-Received: by 2002:a63:1b58:: with SMTP id b24mr20298588pgm.247.1547410524404; Sun, 13 Jan 2019 12:15:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547410524; cv=none; d=google.com; s=arc-20160816; b=IhhV+0ioTnlBe9OMwLQTR/qn8Uo180IjP6YZGRyrpFSWrAAE2gJAubc00GfFJ7RTjB YctOFSlW9SsczMDH58dT2kaMpxdvtgcSWgkVmqlq9ve2nOQmx7uQDqXW6mQXDBQU2fxk ouvcFEMjlLfyki+uhNTGDkaDvGyPU/TDClIw5+kge459BqIOz60a5w/41jQlPSFa6XVZ TSlyMuCIF+WHqb6mBczeO7vyfySOTj3/BUd2efTLlu8QTYc1lMwE1yDYCvFgTEV+UAlz d2VYVMmVg2XTTkLK8oYDVTc+z6GFECjZmRX362P6LFZpL0VU2uNMrfEIOLbTIeW+KrqI 4dVg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tBEaCQcsIQTc8v6Be/2Rjso4xya55Sm4Y5LoVasWh1k=; b=aMpDI9s6GTZIXQWDHZxWdL+YOLXTGO2eFIJlskWEkT7RgGavaotp7kXFym3yy0iNkZ e4bL3ats74R0ACgi2LzTqbXijjid8MMTh/ek+LHbaBnUxm0jtVyweHgoKBr1G4ksfryS xu9TTY2Idbw1+mPbhqN5MleRj7HjWDHH2x/cIpJ99KEawE7vZ6RFv4QElhRKZ7zmFheL Ye9gslOoPmBMziVQsHe7o299bMdekFmVlxTjmk7Nlsp5UMezx7R/9X1WzoFw6Rpp12bH Q2VVHGqZO+X0zqhbzbZ0mB2EF6YXxgkP2r2hy4AA1CwkZqihbs3+VH7AC7UUyBXgf7kZ EYEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b="TOfZ3G/t"; 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 e7si5275142pgv.499.2019.01.13.12.15.07; Sun, 13 Jan 2019 12:15:24 -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=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b="TOfZ3G/t"; 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 S1726561AbfAMUN5 (ORCPT + 99 others); Sun, 13 Jan 2019 15:13:57 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:53553 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726428AbfAMUN4 (ORCPT ); Sun, 13 Jan 2019 15:13:56 -0500 Received: by mail-it1-f194.google.com with SMTP id g85so10252744ita.3 for ; Sun, 13 Jan 2019 12:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tBEaCQcsIQTc8v6Be/2Rjso4xya55Sm4Y5LoVasWh1k=; b=TOfZ3G/tzVZzTUjTji3MO0Mc/ZclNQccKN39Yl3KMAYkTgatbK1XMoZHInqS9pjxzV oQj//kxKOV66yqW4Eej5+vfluY5MT31GzV3nwqyXKnIYcoQm3IoAJXsBc/LjLIIR2nPj Uid9rRx58HFyOLjuL4F5IG7IyD75oaRzfje4aIHJOiulKt5xzJIivaxNkN60qEiklT5t hlRo8xdCzl61xUej6S9/VS5YEbedt6k/UtPPCgIRfscKs0kHjWHm10tUK2nAKQ1N13XA MpjFI/A7Ap3P+clGPRARkOpEzoQj2mWu1AmeAnfmHAnQC7UH800e7Me7RHKTco1/6c6G aNZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tBEaCQcsIQTc8v6Be/2Rjso4xya55Sm4Y5LoVasWh1k=; b=iWheOrxFm/SxSZfi3D0cFSZPnQK/hCeOUtKGllGDUxzhgrcvej3+H+1jveRlnXJ1Hr eU1IOAgUitncawKD5tcXyk8IuzonBRx8+ehwY8yoaVIyrbalBHcj1S4gneWfcOMApuf7 qi1SiPRpq78QlUngRn+RgOqUTvjJwzgdNqteqT+YE2NvSlR7QazG02/z+X6JjrBg2OkL qEXRHmli7SPMgD/MIvZYR2pbOlbrmIsYnJGFj7CaYX2GihXF5gKFsf/rNTPHacU3i0p5 W5sFr8TM/Ec4SsHAl1pmisVLzzofu3fnwAoHfzcH2budANBPu/TlSEMcKiokT6yL6Rby 1j4A== X-Gm-Message-State: AJcUukckihIrFlbutFPWd36rBTgZnakUnYWb5qOx0Zv5EXKQYoX45njD CZauMKVTsq5LOqgBt/ogQgOHuDMdVJG35n/Ka/F61TJFBS4= X-Received: by 2002:a02:63c9:: with SMTP id j192mr16187795jac.10.1547404551140; Sun, 13 Jan 2019 10:35:51 -0800 (PST) MIME-Version: 1.0 References: <20190110111535.11235-1-anders.roxell@linaro.org> In-Reply-To: <20190110111535.11235-1-anders.roxell@linaro.org> From: Olof Johansson Date: Sun, 13 Jan 2019 10:35:40 -0800 Message-ID: Subject: Re: [PATCH] dma: ixm-dma: fix warning comparison of distinct pointer types To: Anders Roxell Cc: Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 10, 2019 at 3:15 AM Anders Roxell wr= ote: > > 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 =E2=80=98imxdma_sg_next=E2=80=99: > ../include/linux/kernel.h:846:29: warning: comparison of distinct pointer= types lacks a cast > (!!(sizeof((typeof(x) *)1 =3D=3D (typeof(y) *)1))) > ^~ > ../include/linux/kernel.h:860:4: note: in expansion of macro =E2=80=98__t= ypecheck=E2=80=99 > (__typecheck(x, y) && __no_side_effects(x, y)) > ^~~~~~~~~~~ > ../include/linux/kernel.h:870:24: note: in expansion of macro =E2=80=98__= safe_cmp=E2=80=99 > __builtin_choose_expr(__safe_cmp(x, y), \ > ^~~~~~~~~~ > ../include/linux/kernel.h:879:19: note: in expansion of macro =E2=80=98__= careful_cmp=E2=80=99 > #define min(x, y) __careful_cmp(x, y, <) > ^~~~~~~~~~~~~ > ../drivers/dma/imx-dma.c:288:8: note: in expansion of macro =E2=80=98min= =E2=80=99 > now =3D 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 'now' should probably also be a size_t, but it can be done separately. imxdma_sg_next()'s return value is never checked anywhere, so the function can be changed to void as well. That being said, I think this specific patch should go in now to keep warnings out of our standard builds. The more we keep around, the harder it is to spot when a new legitimate one shows up. Acked-by: Olof Johansson -Olof