* [PATCH] rt-tests: oslat: Fix compile warnings
@ 2023-08-08 18:55 John Kacur
0 siblings, 0 replies; only message in thread
From: John Kacur @ 2023-08-08 18:55 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix comile warnings in oslat
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/oslat/oslat.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index 99f86b858e33..4bdca643da72 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -220,7 +220,7 @@ struct global {
static struct global g;
-static void workload_nop(char *dst, char *src, size_t size)
+static void workload_nop(char *dst __attribute__ ((unused)), char *src __attribute__ ((unused)), size_t size __attribute__ ((unused)))
{
/* Nop */
}
@@ -474,7 +474,8 @@ static double bucket_to_lat(int bucket)
void calculate(struct thread *t)
{
- int i, j;
+ int j;
+ unsigned int i;
double sum;
uint64_t count;
@@ -493,7 +494,8 @@ void calculate(struct thread *t)
static void write_summary(struct thread *t)
{
- int i, j, k, print_dotdotdot = 0;
+ int j, print_dotdotdot = 0;
+ unsigned long int i, k;
char bucket_name[64];
calculate(t);
@@ -536,12 +538,13 @@ static void write_summary(struct thread *t)
static void write_summary_json(FILE *f, void *data)
{
struct thread *t = data;
- int i, j, comma;
+ int j, comma;
+ unsigned long int i;
fprintf(f, " \"num_threads\": %d,\n", g.n_threads);
fprintf(f, " \"thread\": {\n");
for (i = 0; i < g.n_threads; ++i) {
- fprintf(f, " \"%u\": {\n", i);
+ fprintf(f, " \"%lu\": {\n", i);
fprintf(f, " \"cpu\": %d,\n", t[i].core_i);
fprintf(f, " \"freq\": %d,\n", t[i].counter_mhz);
fprintf(f, " \"min\": %" PRIu64 ",\n", t[i].minlat);
@@ -568,7 +571,7 @@ static void write_summary_json(FILE *f, void *data)
static void run_expt(struct thread *threads, int runtime_secs, bool preheat)
{
- int i;
+ unsigned long int i;
g.runtime_secs = runtime_secs;
g.preheat = preheat;
@@ -593,7 +596,7 @@ static void run_expt(struct thread *threads, int runtime_secs, bool preheat)
pthread_join(threads[i].thread_id, NULL);
}
-static void handle_alarm(int code)
+static void handle_alarm(int code __attribute__ ((unused)))
{
g.cmd = STOP;
}
@@ -839,7 +842,7 @@ void dump_globals(void)
static void record_bias(struct thread *t)
{
- int i;
+ unsigned long int i;
uint64_t bias = (uint64_t)-1;
if (!g.enable_bias)
@@ -858,7 +861,8 @@ static void record_bias(struct thread *t)
int main(int argc, char *argv[])
{
struct thread *threads;
- int i, n_cores;
+ int n_cores;
+ unsigned long int i;
struct bitmask *cpu_set = NULL;
#ifdef FRC_MISSING
--
2.40.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-08 19:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-08 18:55 [PATCH] rt-tests: oslat: Fix compile warnings John Kacur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).