|
From: | Richard Henderson |
Subject: | Re: [PATCH v4 04/33] cpu: Add helper cpu_model_from_type() |
Date: | Wed, 1 Nov 2023 20:59:53 -0700 |
User-agent: | Mozilla Thunderbird |
On 11/1/23 17:24, Gavin Shan wrote:
+char *cpu_model_from_type(const char *typename) +{ + const char *suffix = "-" CPU_RESOLVING_TYPE; + + if (!object_class_by_name(typename)) { + return NULL; + } + + if (strlen(typename) > strlen(suffix) && + !strcmp(typename + strlen(typename) - strlen(suffix), suffix)) {
g_str_has_suffix r~
[Prev in Thread] | Current Thread | [Next in Thread] |