Skip to content

Commit 6770473

Browse files
zx2c4gregkh
authored andcommitted
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 Cc: Dimitri Sivanich <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1deac35 commit 6770473

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

drivers/misc/sgi-gru/grumain.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static int gru_assign_asid(struct gru_state *gru)
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,
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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ struct gru_thread_state {
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 {
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,
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);

0 commit comments

Comments
 (0)