From patchwork Thu May 17 15:34:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10406997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5E30160155 for ; Thu, 17 May 2018 15:34:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BCA4285A0 for ; Thu, 17 May 2018 15:34:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 402E6285A6; Thu, 17 May 2018 15:34:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E6FFC2818E for ; Thu, 17 May 2018 15:34:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E4616E99C; Thu, 17 May 2018 15:34:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4EB416E99A for ; Thu, 17 May 2018 15:34:40 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id x9-v6so3284001wrl.13 for ; Thu, 17 May 2018 08:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+giHXt6V/vCgF31H1nBS61XK1OrGoi9/qQoOXDN/SkE=; b=q06gzpqbskNRIvvl4T6deXQ0tk/ELYfefyIblqcCbAbBPEz0RcQ6k3RFc1qrrjSsOo AYdpEjnhQF2KZskGkzY/17+O7vFLh2vKT8Xgu5ocnB2Pr9yI2DDmN+jXk7T3+lgQa0xm QX8Tv7+87iCJp3AQ64dY4v8Fb3fwjnDRObBpOM9BwobkaveQJANhewTHHTV/r2GVXjIS kZD1/Z/BHscbNLPEYv4K22XSfyUU9Ln+/fPusVN46Rqpt1O41dmg4vEsaFhYX6JPO0tA 9tmKAOPXKn9cB8SQZX8CZh96W/BuQ0/L+FDanaTaf9ctUQmEeY7LlmjcPu2T1XsZQDwz sF0g== 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:in-reply-to :references; bh=+giHXt6V/vCgF31H1nBS61XK1OrGoi9/qQoOXDN/SkE=; b=SH0stNtkPY7a/xnFyG92WVi8jwLSMRUX2rpF9R0ZlGpCxrLB2Pd3cuZqsXjzCdj/yz jnIvJPMWnbF/DZA8bB8UA+3zM3Mq7z3wyht1jrljBf/2WU/2FOl786c2D+4iM/cxFJ1R 1rpdbqMX/vjoyqv2kOVFojagc5OIwBaOJFOCcDbbpTQgIhRnjIQQKqqPX+fisFTUcFsE TsqwAeC9eJpqmdSglCVnFTTy0kckokoj50kAoFAfR2SN/0R0j7OyW81WSjVuxixUWuRf H9hGY+G42oo3UJPaj5cLbuuKBO8raM+SsZ+jjSqeP7cB5Hpd9flUHa115kRgD8tPSD4o 74oQ== X-Gm-Message-State: ALKqPwe5ZqyJlmSH/L7l6NkATuPsgYp0xkEdP0TRiuRMFB9P0GPN0hI7 YwwvtRqsCbhuYj/De52rM/s= X-Google-Smtp-Source: AB8JxZqdxuEiLAycbzbCQtiG3wfmajEtaruZ7i86GyXvt4HfaYBCnPnDJkOZt4Yk8B1hbOUJZoWSjA== X-Received: by 2002:adf:81c2:: with SMTP id 60-v6mr4648887wra.13.1526571278864; Thu, 17 May 2018 08:34:38 -0700 (PDT) Received: from localhost (p200300E41F19FC00D958180F3872A5C5.dip0.t-ipconnect.de. [2003:e4:1f19:fc00:d958:180f:3872:a5c5]) by smtp.gmail.com with ESMTPSA id x24-v6sm4288197wmh.18.2018.05.17.08.34.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 May 2018 08:34:37 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH 3/7] gpu: host1x: Cleanup loop variable usage Date: Thu, 17 May 2018 17:34:26 +0200 Message-Id: <20180517153430.9602-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517153430.9602-1-thierry.reding@gmail.com> References: <20180517153430.9602-1-thierry.reding@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, Dmitry Osipenko , dri-devel@lists.freedesktop.org, Mikko Perttunen MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Use unsigned int where possible and don't unnecessarily initialize the loop variable. Signed-off-by: Thierry Reding Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko --- drivers/gpu/host1x/debug.c | 2 +- drivers/gpu/host1x/intr.c | 2 +- drivers/gpu/host1x/job.c | 4 ++-- drivers/gpu/host1x/syncpt.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/host1x/debug.c b/drivers/gpu/host1x/debug.c index dc77ec452ffc..329e4a3d8ae7 100644 --- a/drivers/gpu/host1x/debug.c +++ b/drivers/gpu/host1x/debug.c @@ -103,7 +103,7 @@ static void show_syncpts(struct host1x *m, struct output *o) static void show_all(struct host1x *m, struct output *o, bool show_fifo) { - int i; + unsigned int i; host1x_hw_show_mlocks(m, o); show_syncpts(m, o); diff --git a/drivers/gpu/host1x/intr.c b/drivers/gpu/host1x/intr.c index 8b4fad0ab35d..6028cf7b681f 100644 --- a/drivers/gpu/host1x/intr.c +++ b/drivers/gpu/host1x/intr.c @@ -144,7 +144,7 @@ static const action_handler action_handlers[HOST1X_INTR_ACTION_COUNT] = { static void run_handlers(struct list_head completed[HOST1X_INTR_ACTION_COUNT]) { struct list_head *head = completed; - int i; + unsigned int i; for (i = 0; i < HOST1X_INTR_ACTION_COUNT; ++i, ++head) { action_handler handler = action_handlers[i]; diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 3cbfc6e37668..2be0bcaf8288 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -196,10 +196,10 @@ static unsigned int pin_job(struct host1x *host, struct host1x_job *job) static int do_relocs(struct host1x_job *job, struct host1x_job_gather *g) { - int i = 0; u32 last_page = ~0; void *cmdbuf_page_addr = NULL; struct host1x_bo *cmdbuf = g->bo; + unsigned int i; /* pin & patch the relocs for one gather */ for (i = 0; i < job->num_relocs; i++) { @@ -451,7 +451,7 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev) struct host1x_firewall fw; size_t size = 0; size_t offset = 0; - int i; + unsigned int i; fw.job = job; fw.dev = dev; diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index a108669188e8..088c05dd884c 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c @@ -57,8 +57,8 @@ static struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host, struct host1x_client *client, unsigned long flags) { - int i; struct host1x_syncpt *sp = host->syncpt; + unsigned int i; char *name; mutex_lock(&host->syncpt_mutex);