code review fix

Signed-off-by: Yalcin Ozbek <yalcinozbekceng@gmail.com>
This commit is contained in:
Yalcin Ozbek 2022-11-05 15:06:30 +03:00
parent 102439862e
commit 13f00fde46
No known key found for this signature in database
GPG Key ID: BB0DF4A7800295ED
1 changed files with 5 additions and 5 deletions

View File

@ -244,13 +244,13 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
c.Model = value
case "model name", "cpu":
c.ModelName = value
if c.ModelName == "" {
if c.VendorID == "ARM" && c.ModelName == "" {
if v, err := strconv.ParseUint(c.Model, 0, 16); err == nil {
modelName, isThereModel := armModelToModelName[v]
if !isThereModel {
c.ModelName = "Undefined"
} else {
modelName, exist := armModelToModelName[v]
if exist {
c.ModelName = modelName
} else {
c.ModelName = "Undefined"
}
}
}