History

misc: sgi-gru: use explicitly signed char

With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like: drivers/misc/sgi-gru/grumain.c:711 gru_check_chiplet_assignment() warn: 'gts->ts_user_chiplet_id' is unsigned

Jason A. Donenfeld committed 4 years ago

Commit 67704731 parent 1deac352 files · +10 −10Browse files

Unified · Split

2 files
  1. drivers/misc/sgi-gru/grumain.c +3 −3
  2. drivers/misc/sgi-gru/grutables.h +7 −7
drivers/misc/sgi-gru/grumain.c+3−3
@@ -152,7 +152,7 @@ static int gru_assign_asid(struct gru_state *gru) · 151 unmodified lines
152 * Optionally, build an array of chars that contain the bit numbers allocated.152 * Optionally, build an array of chars that contain the bit numbers allocated.
153 */153 */
154static unsigned long reserve_resources(unsigned long *p, int n, int mmax,154static unsigned long reserve_resources(unsigned long *p, int n, int mmax,
155 char *idx)155 signed char *idx)
156{156{
157 unsigned long bits = 0;157 unsigned long bits = 0;
158 int i;158 int i;
@@ -170,14 +170,14 @@ static unsigned long reserve_resources(unsigned long *p, int n, int mmax, · 11 unmodified lines
170}170}
171 171
172unsigned long gru_reserve_cb_resources(struct gru_state *gru, int cbr_au_count,172unsigned long gru_reserve_cb_resources(struct gru_state *gru, int cbr_au_count,
173 char *cbmap)173 signed char *cbmap)
174{174{
175 return reserve_resources(&gru->gs_cbr_map, cbr_au_count, GRU_CBR_AU,175 return reserve_resources(&gru->gs_cbr_map, cbr_au_count, GRU_CBR_AU,
176 cbmap);176 cbmap);
177}177}
178 178
179unsigned long gru_reserve_ds_resources(struct gru_state *gru, int dsr_au_count,179unsigned long gru_reserve_ds_resources(struct gru_state *gru, int dsr_au_count,
180 char *dsmap)180 signed char *dsmap)
181{181{
182 return reserve_resources(&gru->gs_dsr_map, dsr_au_count, GRU_DSR_AU,182 return reserve_resources(&gru->gs_dsr_map, dsr_au_count, GRU_DSR_AU,
183 dsmap);183 dsmap);
drivers/misc/sgi-gru/grutables.h+7−7
@@ -351,7 +351,7 @@ struct gru_thread_state { · 350 unmodified lines
351 pid_t ts_tgid_owner; /* task that is using the351 pid_t ts_tgid_owner; /* task that is using the
352 context - for migration */352 context - for migration */
353 short ts_user_blade_id;/* user selected blade */353 short ts_user_blade_id;/* user selected blade */
354 char ts_user_chiplet_id;/* user selected chiplet */354 signed char ts_user_chiplet_id;/* user selected chiplet */
355 unsigned short ts_sizeavail; /* Pagesizes in use */355 unsigned short ts_sizeavail; /* Pagesizes in use */
356 int ts_tsid; /* thread that owns the356 int ts_tsid; /* thread that owns the
357 structure */357 structure */
@@ -364,11 +364,11 @@ struct gru_thread_state { · 6 unmodified lines
364 required for contest */364 required for contest */
365 unsigned char ts_cbr_au_count;/* Number of CBR resources365 unsigned char ts_cbr_au_count;/* Number of CBR resources
366 required for contest */366 required for contest */
367 char ts_cch_req_slice;/* CCH packet slice */367 signed char ts_cch_req_slice;/* CCH packet slice */
368 char ts_blade; /* If >= 0, migrate context if368 signed char ts_blade; /* If >= 0, migrate context if
369 ref from different blade */369 ref from different blade */
370 char ts_force_cch_reload;370 signed char ts_force_cch_reload;
371 char ts_cbr_idx[GRU_CBR_AU];/* CBR numbers of each371 signed char ts_cbr_idx[GRU_CBR_AU];/* CBR numbers of each
372 allocated CB */372 allocated CB */
373 int ts_data_valid; /* Indicates if ts_gdata has373 int ts_data_valid; /* Indicates if ts_gdata has
374 valid data */374 valid data */
@@ -643,9 +643,9 @@ extern struct gru_thread_state *gru_alloc_gts(struct vm_area_struct *vma, · 268 unmodified lines
643 int cbr_au_count, int dsr_au_count,643 int cbr_au_count, int dsr_au_count,
644 unsigned char tlb_preload_count, int options, int tsid);644 unsigned char tlb_preload_count, int options, int tsid);
645extern unsigned long gru_reserve_cb_resources(struct gru_state *gru,645extern unsigned long gru_reserve_cb_resources(struct gru_state *gru,
646 int cbr_au_count, char *cbmap);646 int cbr_au_count, signed char *cbmap);
647extern unsigned long gru_reserve_ds_resources(struct gru_state *gru,647extern unsigned long gru_reserve_ds_resources(struct gru_state *gru,
648 int dsr_au_count, char *dsmap);648 int dsr_au_count, signed char *dsmap);
649extern vm_fault_t gru_fault(struct vm_fault *vmf);649extern vm_fault_t gru_fault(struct vm_fault *vmf);
650extern struct gru_mm_struct *gru_register_mmu_notifier(void);650extern struct gru_mm_struct *gru_register_mmu_notifier(void);
651extern void gru_drop_mmu_notifier(struct gru_mm_struct *gms);651extern void gru_drop_mmu_notifier(struct gru_mm_struct *gms);