Commit 0be8fa23 authored by Federico Vaga's avatar Federico Vaga

tools: improve code readability

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 8ddd03ea
......@@ -39,10 +39,25 @@ static void help(char *name)
exit(1);
}
/**
* It shows information about a given Mock Turtle device
* @param[in] trtl Mock Turtle device instance
*/
static void trtl_list_device_info(struct trtl_dev *trtl)
{
unsigned int appid = 0, cpucount = 0;
trtl_app_id_get(trtl, &appid);
trtl_cpu_count(trtl, &cpucount);
fprintf(stdout, " Application ID: 0x%08x\n", appid);
fprintf(stdout, " Number of CPU: %d\n", cpucount);
}
int main(int argc, char *argv[])
{
char **list;
unsigned int appid = 0, cpucount = 0;
struct trtl_dev *trtl;
char c;
int i, verbose = 0, err;
......@@ -78,11 +93,11 @@ int main(int argc, char *argv[])
trtl_strerror(errno));
continue;
}
if (verbose == 1) {
trtl_app_id_get(trtl, &appid);
trtl_cpu_count(trtl, &cpucount);
fprintf(stdout, " Application ID: 0x%08x\n", appid);
fprintf(stdout, " Number of CPU: %d\n", cpucount);
switch (verbose) {
case 1:
trtl_list_device_info(trtl);
break;
}
trtl_close(trtl);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment