Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1804302imm; Wed, 16 May 2018 03:23:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqOkDirzRsclQtAbjzodOonUg9grCJC4pT4lqGyFdyi8gdxZ7lCZ9v9Rwqpm9JoBhTqxPJF X-Received: by 2002:a62:4ec8:: with SMTP id c191-v6mr286158pfb.153.1526466222541; Wed, 16 May 2018 03:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526466222; cv=none; d=google.com; s=arc-20160816; b=HpEq2FZp4z+8o9R2VRUUe2PwJGsQGe/KiQKcfUGmDp9BQhZhS4NHBMnKVJj65bY8Ln jdicquxbSBi+ZhCUQBlM2iOll4lbSP61usNpDoscModfMHM38e3en7VNOoLw5N02RSo3 7odVsMVmq2hJkmhWmoNwNSpNgo84OF+GzlVbuHJwGojuWQoRPNwOUV3qHNTO+VhVyWAI 9dmAee29QKs7TjSpXBcXwl/oWkwvqXK9fich73+mzNw/CpyFh5AK2XDZvhRsnTgTpNPp 7PjNshf2t3T+CX398RhHLAY672NxE3gblA/pLHBj91Rxp2sjN3XtdW+hPxw5WoD9E12Z 2f3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=QApqIEP/+7iDwQm7ZBlsQngpmQLu/Z0uRmW7bbuAenY=; b=m3p08YgnBDS763KCuxyHe+mooS+VZUB3LYlc9aAVDe2b8WctbValxAUorbOjPHenjW QT1Lj41QbrFKtLMhTKH2a9uHZyMs/bZnuJAgYOogHiP7pSiFe/1900rTJI163cf0Hqx+ AabIG1AIl071oEIlZtQDJxPM0fzalKqsA6TDvTvzAjxVJjErahv30+pg8e49+uxcwqAs 81zvsHFsERm2B4m4catuPvAhGZSx09Ns4ynDPuieeWTHWnbNCwFFV4IPdv+ZyOUHD1jy 29WHxZrbCSq5cSIUnRHMqCWh/Ia85mLddhfi39/oVzp66nevGmM0thBw9SHOAAiJCh6j QH0g== ARC-Authentication-Results: i=1; mx.google.com; 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 b9-v6si2064085pli.427.2018.05.16.03.23.28; Wed, 16 May 2018 03:23: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; 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 S1753316AbeEPKWb (ORCPT + 99 others); Wed, 16 May 2018 06:22:31 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:49558 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752999AbeEPKW2 (ORCPT ); Wed, 16 May 2018 06:22:28 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id A314F21518; Wed, 16 May 2018 10:22:27 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c0jLTVdF8rYN; Wed, 16 May 2018 10:22:27 +0000 (UTC) Received: from lianli (31-211-236-16.customers.ownit.se [31.211.236.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id A644C21611; Wed, 16 May 2018 10:22:20 +0000 (UTC) Date: Wed, 16 May 2018 12:22:04 +0200 From: Emil Goode To: Thierry Reding Cc: Thierry Reding , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH v2] gpu: host1x: Fix compiler errors by converting to dma_addr_t Message-ID: <20180516102204.stviarlxgrz3k2nh@lianli> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The compiler is complaining with the following errors: drivers/gpu/host1x/cdma.c:94:48: error: passing argument 3 of ‘dma_alloc_wc’ from incompatible pointer type [-Werror=incompatible-pointer-types] drivers/gpu/host1x/cdma.c:113:48: error: passing argument 3 of ‘dma_alloc_wc’ from incompatible pointer type [-Werror=incompatible-pointer-types] The expected pointer type of the third argument to dma_alloc_wc() is dma_addr_t but phys_addr_t is passed. Change the phys member of struct push_buffer to be dma_addr_t so that we pass the correct type to dma_alloc_wc(). Also check pb->mapped for non-NULL in the destroy function as that is the right way of checking if dma_alloc_wc() was successful. Signed-off-by: Emil Goode --- v2: - Change the phys member type instead of adding casts. - Check pb->mapped in the destroy function as 0 is a valid value for dma_addr_t. drivers/gpu/host1x/cdma.c | 2 +- drivers/gpu/host1x/cdma.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c index 28541b280739..02a0b61be18f 100644 --- a/drivers/gpu/host1x/cdma.c +++ b/drivers/gpu/host1x/cdma.c @@ -51,7 +51,7 @@ static void host1x_pushbuffer_destroy(struct push_buffer *pb) struct host1x_cdma *cdma = pb_to_cdma(pb); struct host1x *host1x = cdma_to_host1x(cdma); - if (!pb->phys) + if (!pb->mapped) return; if (host1x->domain) { diff --git a/drivers/gpu/host1x/cdma.h b/drivers/gpu/host1x/cdma.h index 286d49386be9..446ee1a84969 100644 --- a/drivers/gpu/host1x/cdma.h +++ b/drivers/gpu/host1x/cdma.h @@ -44,7 +44,7 @@ struct host1x_job; struct push_buffer { void *mapped; /* mapped pushbuffer memory */ dma_addr_t dma; /* device address of pushbuffer */ - phys_addr_t phys; /* physical address of pushbuffer */ + dma_addr_t phys; /* physical address of pushbuffer */ u32 fence; /* index we've written */ u32 pos; /* index to write to */ u32 size; -- 2.11.0