Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: host1x: Use unsigned int consistently for IDs

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>

+36 -31
+12 -11
drivers/gpu/host1x/dev.h
··· 45 45 void (*start)(struct host1x_cdma *cdma); 46 46 void (*stop)(struct host1x_cdma *cdma); 47 47 void (*flush)(struct host1x_cdma *cdma); 48 - int (*timeout_init)(struct host1x_cdma *cdma, u32 syncpt_id); 48 + int (*timeout_init)(struct host1x_cdma *cdma, unsigned int syncpt); 49 49 void (*timeout_destroy)(struct host1x_cdma *cdma); 50 50 void (*freeze)(struct host1x_cdma *cdma); 51 51 void (*resume)(struct host1x_cdma *cdma, u32 getptr); ··· 82 82 int (*init_host_sync)(struct host1x *host, u32 cpm, 83 83 void (*syncpt_thresh_work)(struct work_struct *work)); 84 84 void (*set_syncpt_threshold)( 85 - struct host1x *host, u32 id, u32 thresh); 86 - void (*enable_syncpt_intr)(struct host1x *host, u32 id); 87 - void (*disable_syncpt_intr)(struct host1x *host, u32 id); 85 + struct host1x *host, unsigned int id, u32 thresh); 86 + void (*enable_syncpt_intr)(struct host1x *host, unsigned int id); 87 + void (*disable_syncpt_intr)(struct host1x *host, unsigned int id); 88 88 void (*disable_all_syncpt_intrs)(struct host1x *host); 89 89 int (*free_syncpt_irq)(struct host1x *host); 90 90 }; ··· 182 182 } 183 183 184 184 static inline void host1x_hw_intr_set_syncpt_threshold(struct host1x *host, 185 - u32 id, u32 thresh) 185 + unsigned int id, 186 + u32 thresh) 186 187 { 187 188 host->intr_op->set_syncpt_threshold(host, id, thresh); 188 189 } 189 190 190 191 static inline void host1x_hw_intr_enable_syncpt_intr(struct host1x *host, 191 - u32 id) 192 + unsigned int id) 192 193 { 193 194 host->intr_op->enable_syncpt_intr(host, id); 194 195 } 195 196 196 197 static inline void host1x_hw_intr_disable_syncpt_intr(struct host1x *host, 197 - u32 id) 198 + unsigned int id) 198 199 { 199 200 host->intr_op->disable_syncpt_intr(host, id); 200 201 } ··· 212 211 213 212 static inline int host1x_hw_channel_init(struct host1x *host, 214 213 struct host1x_channel *channel, 215 - int chid) 214 + unsigned int id) 216 215 { 217 - return host->channel_op->init(channel, host, chid); 216 + return host->channel_op->init(channel, host, id); 218 217 } 219 218 220 219 static inline int host1x_hw_channel_submit(struct host1x *host, ··· 243 242 244 243 static inline int host1x_hw_cdma_timeout_init(struct host1x *host, 245 244 struct host1x_cdma *cdma, 246 - u32 syncpt_id) 245 + unsigned int syncpt) 247 246 { 248 - return host->cdma_op->timeout_init(cdma, syncpt_id); 247 + return host->cdma_op->timeout_init(cdma, syncpt); 249 248 } 250 249 251 250 static inline void host1x_hw_cdma_timeout_destroy(struct host1x *host,
+3 -3
drivers/gpu/host1x/hw/cdma_hw.c
··· 213 213 u32 cmdproc_stop; 214 214 215 215 dev_dbg(host1x->dev, 216 - "resuming channel (id %d, DMAGET restart = 0x%x)\n", 216 + "resuming channel (id %u, DMAGET restart = 0x%x)\n", 217 217 ch->id, getptr); 218 218 219 219 cmdproc_stop = host1x_sync_readl(host1x, HOST1X_SYNC_CMDPROC_STOP); ··· 277 277 return; 278 278 } 279 279 280 - dev_warn(host1x->dev, "%s: timeout: %d (%s), HW thresh %d, done %d\n", 280 + dev_warn(host1x->dev, "%s: timeout: %u (%s), HW thresh %d, done %d\n", 281 281 __func__, cdma->timeout.syncpt->id, cdma->timeout.syncpt->name, 282 282 syncpt_val, cdma->timeout.syncpt_val); 283 283 ··· 291 291 /* 292 292 * Init timeout resources 293 293 */ 294 - static int cdma_timeout_init(struct host1x_cdma *cdma, u32 syncpt_id) 294 + static int cdma_timeout_init(struct host1x_cdma *cdma, unsigned int syncpt) 295 295 { 296 296 INIT_DELAYED_WORK(&cdma->timeout.wq, cdma_timeout_handler); 297 297 cdma->timeout.initialized = true;
+2 -1
drivers/gpu/host1x/hw/channel_hw.c
··· 75 75 { 76 76 struct host1x *host = dev_get_drvdata(job->channel->dev->parent); 77 77 struct host1x_syncpt *sp = host->syncpt + job->syncpt_id; 78 - u32 id, value; 78 + unsigned int id; 79 + u32 value; 79 80 80 81 value = host1x_syncpt_read_max(sp); 81 82 id = sp->base->id;
+2 -2
drivers/gpu/host1x/hw/debug_hw.c
··· 191 191 cbread = host1x_sync_readl(host, HOST1X_SYNC_CBREAD(ch->id)); 192 192 cbstat = host1x_sync_readl(host, HOST1X_SYNC_CBSTAT(ch->id)); 193 193 194 - host1x_debug_output(o, "%d-%s: ", ch->id, dev_name(ch->dev)); 194 + host1x_debug_output(o, "%u-%s: ", ch->id, dev_name(ch->dev)); 195 195 196 196 if (HOST1X_CHANNEL_DMACTRL_DMASTOP_V(dmactrl) || 197 197 !ch->cdma.push_buffer.mapped) { ··· 237 237 u32 val, rd_ptr, wr_ptr, start, end; 238 238 unsigned int data_count = 0; 239 239 240 - host1x_debug_output(o, "%d: fifo:\n", ch->id); 240 + host1x_debug_output(o, "%u: fifo:\n", ch->id); 241 241 242 242 val = host1x_ch_readl(ch, HOST1X_CHANNEL_FIFOSTAT); 243 243 host1x_debug_output(o, "FIFOSTAT %08x\n", val);
+6 -3
drivers/gpu/host1x/hw/intr_hw.c
··· 107 107 } 108 108 109 109 static void _host1x_intr_set_syncpt_threshold(struct host1x *host, 110 - u32 id, u32 thresh) 110 + unsigned int id, 111 + u32 thresh) 111 112 { 112 113 host1x_sync_writel(host, thresh, HOST1X_SYNC_SYNCPT_INT_THRESH(id)); 113 114 } 114 115 115 - static void _host1x_intr_enable_syncpt_intr(struct host1x *host, u32 id) 116 + static void _host1x_intr_enable_syncpt_intr(struct host1x *host, 117 + unsigned int id) 116 118 { 117 119 host1x_sync_writel(host, BIT_MASK(id), 118 120 HOST1X_SYNC_SYNCPT_THRESH_INT_ENABLE_CPU0(BIT_WORD(id))); 119 121 } 120 122 121 - static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id) 123 + static void _host1x_intr_disable_syncpt_intr(struct host1x *host, 124 + unsigned int id) 122 125 { 123 126 host1x_sync_writel(host, BIT_MASK(id), 124 127 HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(BIT_WORD(id)));
+4 -4
drivers/gpu/host1x/intr.c
··· 209 209 host1x_syncpt_load(host->syncpt + id)); 210 210 } 211 211 212 - int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh, 212 + int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh, 213 213 enum host1x_intr_action action, void *data, 214 214 struct host1x_waitlist *waiter, void **ref) 215 215 { ··· 254 254 return 0; 255 255 } 256 256 257 - void host1x_intr_put_ref(struct host1x *host, u32 id, void *ref) 257 + void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref) 258 258 { 259 259 struct host1x_waitlist *waiter = ref; 260 260 struct host1x_syncpt *syncpt; ··· 285 285 INIT_LIST_HEAD(&syncpt->intr.wait_head); 286 286 snprintf(syncpt->intr.thresh_irq_name, 287 287 sizeof(syncpt->intr.thresh_irq_name), 288 - "host1x_sp_%02d", id); 288 + "host1x_sp_%02u", id); 289 289 } 290 290 291 291 host1x_intr_start(host); ··· 338 338 if (!list_empty(&syncpt[id].intr.wait_head)) { 339 339 /* output diagnostics */ 340 340 mutex_unlock(&host->intr_mutex); 341 - pr_warn("%s cannot stop syncpt intr id=%d\n", 341 + pr_warn("%s cannot stop syncpt intr id=%u\n", 342 342 __func__, id); 343 343 return; 344 344 }
+2 -2
drivers/gpu/host1x/intr.h
··· 75 75 * 76 76 * This is a non-blocking api. 77 77 */ 78 - int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh, 78 + int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh, 79 79 enum host1x_intr_action action, void *data, 80 80 struct host1x_waitlist *waiter, void **ref); 81 81 ··· 84 84 * You must call this if you passed non-NULL as ref. 85 85 * @ref the ref returned from host1x_intr_add_action() 86 86 */ 87 - void host1x_intr_put_ref(struct host1x *host, u32 id, void *ref); 87 + void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref); 88 88 89 89 /* Initialize host1x sync point interrupt */ 90 90 int host1x_intr_init(struct host1x *host, unsigned int irq_sync);
+1 -1
drivers/gpu/host1x/job.c
··· 161 161 162 162 if (host1x_syncpt_is_expired(sp, wait->thresh)) { 163 163 dev_dbg(host->dev, 164 - "drop WAIT id %d (%s) thresh 0x%x, min 0x%x\n", 164 + "drop WAIT id %u (%s) thresh 0x%x, min 0x%x\n", 165 165 wait->syncpt_id, sp->name, wait->thresh, 166 166 host1x_syncpt_read_min(sp)); 167 167
+3 -3
drivers/gpu/host1x/syncpt.c
··· 73 73 return NULL; 74 74 } 75 75 76 - name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id, 76 + name = kasprintf(GFP_KERNEL, "%02u-%s", sp->id, 77 77 dev ? dev_name(dev) : NULL); 78 78 if (!name) 79 79 return NULL; ··· 255 255 timeout -= check; 256 256 if (timeout && check_count <= MAX_STUCK_CHECK_COUNT) { 257 257 dev_warn(sp->host->dev, 258 - "%s: syncpoint id %d (%s) stuck waiting %d, timeout=%ld\n", 258 + "%s: syncpoint id %u (%s) stuck waiting %d, timeout=%ld\n", 259 259 current->comm, sp->id, sp->name, 260 260 thresh, timeout); 261 261 ··· 447 447 return host->info->nb_mlocks; 448 448 } 449 449 450 - struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, u32 id) 450 + struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, unsigned int id) 451 451 { 452 452 if (host->info->nb_pts < id) 453 453 return NULL;
+1 -1
drivers/gpu/host1x/syncpt.h
··· 37 37 }; 38 38 39 39 struct host1x_syncpt { 40 - int id; 40 + unsigned int id; 41 41 atomic_t min_val; 42 42 atomic_t max_val; 43 43 u32 base_val;