From: Bart Van Assche Date: Sat, 18 Jan 2020 04:50:19 +0000 (-0800) Subject: stat: Remove more superfluous casts X-Git-Tag: fio-3.18~10^2~6 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c0a6be6c1ee7c4989eb0b7a2b3362eaa8e6d1b27;p=fio.git stat: Remove more superfluous casts No cast is necessary to pass a char * argument to a function that accepts a const char * argument. Signed-off-by: Bart Van Assche --- diff --git a/stat.c b/stat.c index 4d5b2436..a3736c9a 100644 --- a/stat.c +++ b/stat.c @@ -1308,7 +1308,7 @@ static void add_ddir_status_json(struct thread_stat *ts, json_object_add_value_object(tmp_object, "percentile", percentile_object); for (i = 0; i < len; i++) { snprintf(buf, sizeof(buf), "%f", ts->percentile_list[i].u.f); - json_object_add_value_int(percentile_object, (const char *)buf, ovals[i]); + json_object_add_value_int(percentile_object, buf, ovals[i]); } if (output_format & FIO_OUTPUT_JSON_PLUS) { @@ -1320,12 +1320,12 @@ static void add_ddir_status_json(struct thread_stat *ts, if (ddir_rw(ddir)) { if (ts->io_u_plat[ddir][i]) { snprintf(buf, sizeof(buf), "%llu", plat_idx_to_val(i)); - json_object_add_value_int(clat_bins_object, (const char *)buf, ts->io_u_plat[ddir][i]); + json_object_add_value_int(clat_bins_object, buf, ts->io_u_plat[ddir][i]); } } else { if (ts->io_u_sync_plat[i]) { snprintf(buf, sizeof(buf), "%llu", plat_idx_to_val(i)); - json_object_add_value_int(clat_bins_object, (const char *)buf, ts->io_u_sync_plat[i]); + json_object_add_value_int(clat_bins_object, buf, ts->io_u_sync_plat[i]); } } } @@ -1661,7 +1661,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts, snprintf(buf, sizeof(buf), "%f", ts->percentile_list[i].u.f); json_object_add_value_int(percentile_object, - (const char *)buf, + buf, percentiles[i]); }