Hi!
Here is the last nit (the rest of the code looks ok).
Applies for the next test as well.
> +void setup(void)
> +{
> + char path[BUFSIZ];
> +
> + tst_require_root(NULL);
> +
> + if (access(PATH_THP, F_OK) == -1)
> + tst_brkm(TCONF, NULL, "THP is not enabled");
> +
> + if (!is_numa(NULL))
> + tst_brkm(TCONF, NULL, "The case need a NUMA system.");
> +
> + SAFE_FILE_SCANF(NULL, PATH_KHPD "scan_sleep_millisecs",
> + "%d", &pre_thp_scan_sleep_millisecs);
> + SAFE_FILE_PRINTF(NULL, PATH_KHPD "scan_sleep_millisecs", "%d", 0);
> +
> + SAFE_FILE_SCANF(NULL, PATH_KHPD "alloc_sleep_millisecs",
> + "%d", &pre_thp_alloc_sleep_millisecs);
> + SAFE_FILE_PRINTF(NULL, PATH_KHPD "alloc_sleep_millisecs", "%d", 0);
No need to convert the constant integer via "%d", just pass the "0"
string.
> + SAFE_FILE_SCANF(NULL, PATH_THP "enabled", "%[^\n]", pre_thp_enabled);
> + SAFE_FILE_PRINTF(NULL, PATH_THP "enabled", "%s", "always");
No need to pass the "always" via "%s", just pass it directly.
> +
> + tst_sig(FORK, DEF_HANDLER, NULL);
> + TEST_PAUSE;
> +}
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list