Re: [PATCH v3 08/12] amd-pstate-ut: Add ability to run a single testcase

From: Mario Limonciello

Date: Wed Mar 25 2026 - 09:53:15 EST




On 3/24/26 23:28, K Prateek Nayak wrote:
Hello Gautham,

On 3/24/2026 9:59 AM, Gautham R. Shenoy wrote:
+static bool test_in_list(const char *list, const char *name)
+{
+ size_t name_len = strlen(name);
+ const char *p = list;
+
+ while (*p) {
+ const char *sep = strchr(p, ';');

Any particular reason for using a ";" as the separator instead of ","?

I personally prefer "," because with ";", I need to explicitly add
'' around the test_list otherwise bash thinks the command ends at ";"
but with "," that is avoided.

Thoughts?


Sure, that sounds like a good reason to use a comma instead.

+ size_t token_len = sep ? sep - p : strlen(p);
+
+ if (token_len == name_len && !strncmp(p, name, token_len))
+ return true;
+
+ if (!sep)
+ break;
+ p = sep + 1;
+ }
+
+ return false;
+}