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
152152 * Optionally, build an array of chars that contain the bit numbers allocated.
153153 */
154154 static unsigned long reserve_resources(unsigned long *p, int n, int mmax,
155− char *idx)
155+ signed char *idx)
156156 {
157157 unsigned long bits = 0;
158158 int i;
@@ -170,14 +170,14 @@ static unsigned long reserve_resources(unsigned long *p, int n, int mmax, · 11 unmodified lines
170170 }
171171
172172 unsigned long gru_reserve_cb_resources(struct gru_state *gru, int cbr_au_count,
173− char *cbmap)
173+ signed char *cbmap)
174174 {
175175 return reserve_resources(&gru->gs_cbr_map, cbr_au_count, GRU_CBR_AU,
176176 cbmap);
177177 }
178178
179179 unsigned long gru_reserve_ds_resources(struct gru_state *gru, int dsr_au_count,
180− char *dsmap)
180+ signed char *dsmap)
181181 {
182182 return reserve_resources(&gru->gs_dsr_map, dsr_au_count, GRU_DSR_AU,
183183 dsmap);
drivers/misc/sgi-gru/grutables.h+7−7
@@ -351,7 +351,7 @@ struct gru_thread_state { · 350 unmodified lines
351351 pid_t ts_tgid_owner; /* task that is using the
352352 context - for migration */
353353 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 */
355355 unsigned short ts_sizeavail; /* Pagesizes in use */
356356 int ts_tsid; /* thread that owns the
357357 structure */
@@ -364,11 +364,11 @@ struct gru_thread_state { · 6 unmodified lines
364364 required for contest */
365365 unsigned char ts_cbr_au_count;/* Number of CBR resources
366366 required for contest */
367− char ts_cch_req_slice;/* CCH packet slice */
368− char ts_blade; /* If >= 0, migrate context if
367+ signed char ts_cch_req_slice;/* CCH packet slice */
368+ signed char ts_blade; /* If >= 0, migrate context if
369369 ref from different blade */
370− char ts_force_cch_reload;
371− char ts_cbr_idx[GRU_CBR_AU];/* CBR numbers of each
370+ signed char ts_force_cch_reload;
371+ signed char ts_cbr_idx[GRU_CBR_AU];/* CBR numbers of each
372372 allocated CB */
373373 int ts_data_valid; /* Indicates if ts_gdata has
374374 valid data */
@@ -643,9 +643,9 @@ extern struct gru_thread_state *gru_alloc_gts(struct vm_area_struct *vma, · 268 unmodified lines
643643 int cbr_au_count, int dsr_au_count,
644644 unsigned char tlb_preload_count, int options, int tsid);
645645 extern 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);
647647 extern 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);
649649 extern vm_fault_t gru_fault(struct vm_fault *vmf);
650650 extern struct gru_mm_struct *gru_register_mmu_notifier(void);
651651 extern void gru_drop_mmu_notifier(struct gru_mm_struct *gms);