gpu: host1x: Use unsigned int consistently for IDs
authorThierry Reding <treding@nvidia.com>
Thu, 23 Jun 2016 09:19:00 +0000 (11:19 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 23 Jun 2016 09:59:24 +0000 (11:59 +0200)
IDs can never be negative so use unsigned int. In some instances an
explicitly sized type (such as u32) was used for no particular reason,
so turn those into unsigned int as well for consistency.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/dev.h
drivers/gpu/host1x/hw/cdma_hw.c
drivers/gpu/host1x/hw/channel_hw.c
drivers/gpu/host1x/hw/debug_hw.c
drivers/gpu/host1x/hw/intr_hw.c
drivers/gpu/host1x/intr.c
drivers/gpu/host1x/intr.h
drivers/gpu/host1x/job.c
drivers/gpu/host1x/syncpt.c
drivers/gpu/host1x/syncpt.h

index e3fd1f0694c678507749531aa4ca4648587b442f..5220510f39dae91c219b29d40062b3e689fcb815 100644 (file)
@@ -45,7 +45,7 @@ struct host1x_cdma_ops {
        void (*start)(struct host1x_cdma *cdma);
        void (*stop)(struct host1x_cdma *cdma);
        void (*flush)(struct  host1x_cdma *cdma);
-       int (*timeout_init)(struct host1x_cdma *cdma, u32 syncpt_id);
+       int (*timeout_init)(struct host1x_cdma *cdma, unsigned int syncpt);
        void (*timeout_destroy)(struct host1x_cdma *cdma);
        void (*freeze)(struct host1x_cdma *cdma);
        void (*resume)(struct host1x_cdma *cdma, u32 getptr);
@@ -82,9 +82,9 @@ struct host1x_intr_ops {
        int (*init_host_sync)(struct host1x *host, u32 cpm,
                void (*syncpt_thresh_work)(struct work_struct *work));
        void (*set_syncpt_threshold)(
-               struct host1x *host, u32 id, u32 thresh);
-       void (*enable_syncpt_intr)(struct host1x *host, u32 id);
-       void (*disable_syncpt_intr)(struct host1x *host, u32 id);
+               struct host1x *host, unsigned int id, u32 thresh);
+       void (*enable_syncpt_intr)(struct host1x *host, unsigned int id);
+       void (*disable_syncpt_intr)(struct host1x *host, unsigned int id);
        void (*disable_all_syncpt_intrs)(struct host1x *host);
        int (*free_syncpt_irq)(struct host1x *host);
 };
@@ -182,19 +182,20 @@ static inline int host1x_hw_intr_init_host_sync(struct host1x *host, u32 cpm,
 }
 
 static inline void host1x_hw_intr_set_syncpt_threshold(struct host1x *host,
-                                                      u32 id, u32 thresh)
+                                                      unsigned int id,
+                                                      u32 thresh)
 {
        host->intr_op->set_syncpt_threshold(host, id, thresh);
 }
 
 static inline void host1x_hw_intr_enable_syncpt_intr(struct host1x *host,
-                                                    u32 id)
+                                                    unsigned int id)
 {
        host->intr_op->enable_syncpt_intr(host, id);
 }
 
 static inline void host1x_hw_intr_disable_syncpt_intr(struct host1x *host,
-                                                     u32 id)
+                                                     unsigned int id)
 {
        host->intr_op->disable_syncpt_intr(host, id);
 }
@@ -211,9 +212,9 @@ static inline int host1x_hw_intr_free_syncpt_irq(struct host1x *host)
 
 static inline int host1x_hw_channel_init(struct host1x *host,
                                         struct host1x_channel *channel,
-                                        int chid)
+                                        unsigned int id)
 {
-       return host->channel_op->init(channel, host, chid);
+       return host->channel_op->init(channel, host, id);
 }
 
 static inline int host1x_hw_channel_submit(struct host1x *host,
@@ -242,9 +243,9 @@ static inline void host1x_hw_cdma_flush(struct host1x *host,
 
 static inline int host1x_hw_cdma_timeout_init(struct host1x *host,
                                              struct host1x_cdma *cdma,
-                                             u32 syncpt_id)
+                                             unsigned int syncpt)
 {
-       return host->cdma_op->timeout_init(cdma, syncpt_id);
+       return host->cdma_op->timeout_init(cdma, syncpt);
 }
 
 static inline void host1x_hw_cdma_timeout_destroy(struct host1x *host,
index 233246e1235ab8eb616889e9f540d0611540603f..e0db00613bca9834dd87b977ccd917f73f1b2385 100644 (file)
@@ -213,7 +213,7 @@ static void cdma_resume(struct host1x_cdma *cdma, u32 getptr)
        u32 cmdproc_stop;
 
        dev_dbg(host1x->dev,
-               "resuming channel (id %d, DMAGET restart = 0x%x)\n",
+               "resuming channel (id %u, DMAGET restart = 0x%x)\n",
                ch->id, getptr);
 
        cmdproc_stop = host1x_sync_readl(host1x, HOST1X_SYNC_CMDPROC_STOP);
@@ -277,7 +277,7 @@ static void cdma_timeout_handler(struct work_struct *work)
                return;
        }
 
-       dev_warn(host1x->dev, "%s: timeout: %d (%s), HW thresh %d, done %d\n",
+       dev_warn(host1x->dev, "%s: timeout: %u (%s), HW thresh %d, done %d\n",
                __func__, cdma->timeout.syncpt->id, cdma->timeout.syncpt->name,
                syncpt_val, cdma->timeout.syncpt_val);
 
@@ -291,7 +291,7 @@ static void cdma_timeout_handler(struct work_struct *work)
 /*
  * Init timeout resources
  */
-static int cdma_timeout_init(struct host1x_cdma *cdma, u32 syncpt_id)
+static int cdma_timeout_init(struct host1x_cdma *cdma, unsigned int syncpt)
 {
        INIT_DELAYED_WORK(&cdma->timeout.wq, cdma_timeout_handler);
        cdma->timeout.initialized = true;
index 946c332c3906ad823826b56b0c25a3300715424c..f359b7ec5e3ceddce83a76798ba286a3f74b972c 100644 (file)
@@ -75,7 +75,8 @@ static inline void synchronize_syncpt_base(struct host1x_job *job)
 {
        struct host1x *host = dev_get_drvdata(job->channel->dev->parent);
        struct host1x_syncpt *sp = host->syncpt + job->syncpt_id;
-       u32 id, value;
+       unsigned int id;
+       u32 value;
 
        value = host1x_syncpt_read_max(sp);
        id = sp->base->id;
index 81e94fef5e428a60eb3f633ffb852557bff39e47..47da9a62ff7e29dcbb0eb47e675627f8e7c9dabb 100644 (file)
@@ -191,7 +191,7 @@ static void host1x_debug_show_channel_cdma(struct host1x *host,
        cbread = host1x_sync_readl(host, HOST1X_SYNC_CBREAD(ch->id));
        cbstat = host1x_sync_readl(host, HOST1X_SYNC_CBSTAT(ch->id));
 
-       host1x_debug_output(o, "%d-%s: ", ch->id, dev_name(ch->dev));
+       host1x_debug_output(o, "%u-%s: ", ch->id, dev_name(ch->dev));
 
        if (HOST1X_CHANNEL_DMACTRL_DMASTOP_V(dmactrl) ||
            !ch->cdma.push_buffer.mapped) {
@@ -237,7 +237,7 @@ static void host1x_debug_show_channel_fifo(struct host1x *host,
        u32 val, rd_ptr, wr_ptr, start, end;
        unsigned int data_count = 0;
 
-       host1x_debug_output(o, "%d: fifo:\n", ch->id);
+       host1x_debug_output(o, "%u: fifo:\n", ch->id);
 
        val = host1x_ch_readl(ch, HOST1X_CHANNEL_FIFOSTAT);
        host1x_debug_output(o, "FIFOSTAT %08x\n", val);
index cf49d72fb1720753a2321445346c0b3ea784e448..f50c68957c12e6c41376e4251c0bd3069d89ec11 100644 (file)
@@ -107,18 +107,21 @@ static int _host1x_intr_init_host_sync(struct host1x *host, u32 cpm,
 }
 
 static void _host1x_intr_set_syncpt_threshold(struct host1x *host,
-       u32 id, u32 thresh)
+                                             unsigned int id,
+                                             u32 thresh)
 {
        host1x_sync_writel(host, thresh, HOST1X_SYNC_SYNCPT_INT_THRESH(id));
 }
 
-static void _host1x_intr_enable_syncpt_intr(struct host1x *host, u32 id)
+static void _host1x_intr_enable_syncpt_intr(struct host1x *host,
+                                           unsigned int id)
 {
        host1x_sync_writel(host, BIT_MASK(id),
                HOST1X_SYNC_SYNCPT_THRESH_INT_ENABLE_CPU0(BIT_WORD(id)));
 }
 
-static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id)
+static void _host1x_intr_disable_syncpt_intr(struct host1x *host,
+                                            unsigned int id)
 {
        host1x_sync_writel(host, BIT_MASK(id),
                HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(BIT_WORD(id)));
index 81de286a2f604986721a34ad73d7811fbd97b28f..c85ca44ff4617f1f1e9f2cbb0bd5f79c99e9c481 100644 (file)
@@ -209,7 +209,7 @@ static void syncpt_thresh_work(struct work_struct *work)
                                host1x_syncpt_load(host->syncpt + id));
 }
 
-int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh,
+int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
                           enum host1x_intr_action action, void *data,
                           struct host1x_waitlist *waiter, void **ref)
 {
@@ -254,7 +254,7 @@ int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh,
        return 0;
 }
 
-void host1x_intr_put_ref(struct host1x *host, u32 id, void *ref)
+void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref)
 {
        struct host1x_waitlist *waiter = ref;
        struct host1x_syncpt *syncpt;
@@ -285,7 +285,7 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync)
                INIT_LIST_HEAD(&syncpt->intr.wait_head);
                snprintf(syncpt->intr.thresh_irq_name,
                         sizeof(syncpt->intr.thresh_irq_name),
-                        "host1x_sp_%02d", id);
+                        "host1x_sp_%02u", id);
        }
 
        host1x_intr_start(host);
@@ -338,7 +338,7 @@ void host1x_intr_stop(struct host1x *host)
                if (!list_empty(&syncpt[id].intr.wait_head)) {
                        /* output diagnostics */
                        mutex_unlock(&host->intr_mutex);
-                       pr_warn("%s cannot stop syncpt intr id=%d\n",
+                       pr_warn("%s cannot stop syncpt intr id=%u\n",
                                __func__, id);
                        return;
                }
index 2b8adf016a05b0fe3cbec0cc9cdb49e2da88ea3b..1370c2bb75b810ff5e275cfbb3b8ef8edb459183 100644 (file)
@@ -75,7 +75,7 @@ struct host1x_waitlist {
  *
  * This is a non-blocking api.
  */
-int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh,
+int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
        enum host1x_intr_action action, void *data,
        struct host1x_waitlist *waiter, void **ref);
 
@@ -84,7 +84,7 @@ int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh,
  * You must call this if you passed non-NULL as ref.
  * @ref the ref returned from host1x_intr_add_action()
  */
-void host1x_intr_put_ref(struct host1x *host, u32 id, void *ref);
+void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref);
 
 /* Initialize host1x sync point interrupt */
 int host1x_intr_init(struct host1x *host, unsigned int irq_sync);
index b4515d54403967dad522594c19dd2052f9c875c0..626707585d9b1a425694cc0971b0ac8e6ba3ce09 100644 (file)
@@ -161,7 +161,7 @@ static int do_waitchks(struct host1x_job *job, struct host1x *host,
 
                if (host1x_syncpt_is_expired(sp, wait->thresh)) {
                        dev_dbg(host->dev,
-                               "drop WAIT id %d (%s) thresh 0x%x, min 0x%x\n",
+                               "drop WAIT id %u (%s) thresh 0x%x, min 0x%x\n",
                                wait->syncpt_id, sp->name, wait->thresh,
                                host1x_syncpt_read_min(sp));
 
index e2c499aa33e1d88d7e5e246f44a28ea71ca22487..3e9119301f6ccd01aa06d05f89eb051388c63c97 100644 (file)
@@ -73,7 +73,7 @@ static struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host,
                        return NULL;
        }
 
-       name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id,
+       name = kasprintf(GFP_KERNEL, "%02u-%s", sp->id,
                        dev ? dev_name(dev) : NULL);
        if (!name)
                return NULL;
@@ -255,7 +255,7 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
                timeout -= check;
                if (timeout && check_count <= MAX_STUCK_CHECK_COUNT) {
                        dev_warn(sp->host->dev,
-                               "%s: syncpoint id %d (%s) stuck waiting %d, timeout=%ld\n",
+                               "%s: syncpoint id %u (%s) stuck waiting %d, timeout=%ld\n",
                                 current->comm, sp->id, sp->name,
                                 thresh, timeout);
 
@@ -447,7 +447,7 @@ unsigned int host1x_syncpt_nb_mlocks(struct host1x *host)
        return host->info->nb_mlocks;
 }
 
-struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, u32 id)
+struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, unsigned int id)
 {
        if (host->info->nb_pts < id)
                return NULL;
index 6916feff0c294c11398c43f8e69a86ea7106fe3f..f719205105ac19192bd8b7881d17ab87810696eb 100644 (file)
@@ -37,7 +37,7 @@ struct host1x_syncpt_base {
 };
 
 struct host1x_syncpt {
-       int id;
+       unsigned int id;
        atomic_t min_val;
        atomic_t max_val;
        u32 base_val;
This page took 0.0317 seconds and 5 git commands to generate.