test: fix t/run-fio-tests.py style issues identified by pylint
[fio.git] / engines / cpu.c
index 68fe202a0ee953c680ef39e0047e94f7708e429c..ce74dbcea8758e776b03b02d41ebb1489cc490c7 100644 (file)
@@ -245,6 +245,7 @@ static int fio_cpuio_init(struct thread_data *td)
        struct thread_options *o = &td->o;
        struct cpu_options *co = td->eo;
        int td_previous_state;
+       char *msg;
 
        if (!co->cpuload) {
                td_vmsg(td, EINVAL, "cpu thread needs rate (cpuload=)","cpuio");
@@ -267,6 +268,7 @@ static int fio_cpuio_init(struct thread_data *td)
         * set thinktime_sleep and thinktime_spin appropriately
         */
        o->thinktime_blocks = 1;
+       o->thinktime_blocks_type = THINKTIME_BLOCKS_TYPE_COMPLETE;
        o->thinktime_spin = 0;
        o->thinktime = ((unsigned long long) co->cpucycle *
                                (100 - co->cpuload)) / co->cpuload;
@@ -281,7 +283,10 @@ static int fio_cpuio_init(struct thread_data *td)
                qsort_init(td);
                break;
        default:
-               td_vmsg(td, EINVAL, "cpu engine mode bad: %d", co->cpumode);
+               if (asprintf(&msg, "bad cpu engine mode: %d", co->cpumode) < 0)
+                       msg = NULL;
+               td_vmsg(td, EINVAL, msg ? : "(?)", __func__);
+               free(msg);
                return 1;
        }