From patchwork Mon Oct 13 10:21:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 5075081 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6D1D79F387 for ; Mon, 13 Oct 2014 10:22:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3F40201F4 for ; Mon, 13 Oct 2014 10:22:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BA558201F5 for ; Mon, 13 Oct 2014 10:22:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15DED89FE6; Mon, 13 Oct 2014 03:22:08 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by gabe.freedesktop.org (Postfix) with ESMTP id C5A6189FDE for ; Mon, 13 Oct 2014 03:22:05 -0700 (PDT) Received: by mail-wi0-f169.google.com with SMTP id h11so2931587wiw.0 for ; Mon, 13 Oct 2014 03:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NoC2hgOBUBTBY7sukuuigxS48d55QN9o1aaUUTK7IyU=; b=evIF5OBEucoec/7UDj8ZlNTkTCTgxYA8OQiJcjfi2+bYUhuyHRMG8XKnlITP7BWKil B4ySbDkIi69iKGM1HK/1fZWU5q2rlwxwjmo48Pw2CK/SQ8L5SJMRPExJ5wUrrT7wCf/2 kVdbyCkLCIqVrm9TdUlQFJIT0S+R5j6j5pNjq0kIzZXx0dQ2JtyW8css5TetLUGhh+vX RPU+rqGljBuy9TWPOMN3Y+54N5YWP23rXNrBsC8zPD+8Hqevk1QelVdQ9EY0NjPBjIhC lUxU42iaE5bq7DzUfbYhilDJFV17xEVaLSWyCYJt3uUi2G+CESPOonK0nPopAg3zZIN+ l4zw== X-Received: by 10.181.13.20 with SMTP id eu20mr23537wid.36.1413195725131; Mon, 13 Oct 2014 03:22:05 -0700 (PDT) Received: from localhost (port-4359.pppoe.wtnet.de. [84.46.17.24]) by mx.google.com with ESMTPSA id gt7sm11648990wib.18.2014.10.13.03.22.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Oct 2014 03:22:04 -0700 (PDT) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH 06/14] gpu: host1x: mipi: Registers are 32 bits wide Date: Mon, 13 Oct 2014 12:21:47 +0200 Message-Id: <1413195715-4719-6-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1413195715-4719-1-git-send-email-thierry.reding@gmail.com> References: <1413195715-4719-1-git-send-email-thierry.reding@gmail.com> Cc: linux-tegra@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding On 64-bit platforms an unsigned long would be 64 bit and cause unnecessary casting when being passed to writel() or returned from readl(). Make register values 32 bits wide to avoid that. Signed-off-by: Thierry Reding --- drivers/gpu/host1x/mipi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/host1x/mipi.c b/drivers/gpu/host1x/mipi.c index 9882ea122024..a3e215a0116f 100644 --- a/drivers/gpu/host1x/mipi.c +++ b/drivers/gpu/host1x/mipi.c @@ -90,16 +90,16 @@ struct tegra_mipi_device { unsigned long pads; }; -static inline unsigned long tegra_mipi_readl(struct tegra_mipi *mipi, - unsigned long reg) +static inline u32 tegra_mipi_readl(struct tegra_mipi *mipi, + unsigned long offset) { - return readl(mipi->regs + (reg << 2)); + return readl(mipi->regs + (offset << 2)); } -static inline void tegra_mipi_writel(struct tegra_mipi *mipi, - unsigned long value, unsigned long reg) +static inline void tegra_mipi_writel(struct tegra_mipi *mipi, u32 value, + unsigned long offset) { - writel(value, mipi->regs + (reg << 2)); + writel(value, mipi->regs + (offset << 2)); } struct tegra_mipi_device *tegra_mipi_request(struct device *device) @@ -161,7 +161,7 @@ EXPORT_SYMBOL(tegra_mipi_free); static int tegra_mipi_wait(struct tegra_mipi *mipi) { unsigned long timeout = jiffies + msecs_to_jiffies(250); - unsigned long value; + u32 value; while (time_before(jiffies, timeout)) { value = tegra_mipi_readl(mipi, MIPI_CAL_STATUS); @@ -177,8 +177,8 @@ static int tegra_mipi_wait(struct tegra_mipi *mipi) int tegra_mipi_calibrate(struct tegra_mipi_device *device) { - unsigned long value; unsigned int i; + u32 value; int err; err = clk_enable(device->mipi->clk);