From d2edddea0ae58ce38a03d3be59c6793b831ab490 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 21 May 2026 14:54:08 +0200 Subject: [PATCH] More clear device test --- cmdline/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmdline/device.c b/cmdline/device.c index 6a830fa0..ddc4eec1 100644 --- a/cmdline/device.c +++ b/cmdline/device.c @@ -952,8 +952,6 @@ int devtest(tommy_list* high, tommy_list* low, int operation) devinfo_t* entry; int j; - ++count; - entry = calloc_nofail(1, sizeof(devinfo_t)); /* fake device number */ @@ -981,7 +979,7 @@ int devtest(tommy_list* high, tommy_list* low, int operation) pathprint(entry->interf, sizeof(entry->interf), "FAKE_%s", devinfo->interf); pathprint(entry->file, sizeof(entry->file), "FAKE_%s", devinfo->file); pathcpy(entry->name, sizeof(entry->name), devinfo->name); - entry->info[INFO_SIZE] = count * TERA; + entry->info[INFO_SIZE] = (count + 1) * TERA; entry->info[INFO_ROTATION_RATE] = 7200; entry->smart[SMART_ERROR_MEDIUM].raw = 0; entry->smart[SMART_ERROR_PROTOCOL].raw = 0; @@ -1001,6 +999,8 @@ int devtest(tommy_list* high, tommy_list* low, int operation) } entry->power = POWER_ACTIVE; + + ++count; } return 0;