| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Based on documentation provided by Dave Jones. Thanks! |
|---|
| 3 | | - * |
|---|
| 4 | | - * Licensed under the terms of the GNU GPL License version 2. |
|---|
| 5 | 4 | * |
|---|
| 6 | 5 | * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* |
|---|
| 7 | 6 | */ |
|---|
| .. | .. |
|---|
| 224 | 223 | case EPS_BRAND_C3: |
|---|
| 225 | 224 | pr_cont("C3\n"); |
|---|
| 226 | 225 | return -ENODEV; |
|---|
| 227 | | - break; |
|---|
| 228 | 226 | } |
|---|
| 229 | 227 | /* Enable Enhanced PowerSaver */ |
|---|
| 230 | 228 | rdmsrl(MSR_IA32_MISC_ENABLE, val); |
|---|
| .. | .. |
|---|
| 323 | 321 | states = 2; |
|---|
| 324 | 322 | |
|---|
| 325 | 323 | /* Allocate private data and frequency table for current cpu */ |
|---|
| 326 | | - centaur = kzalloc(sizeof(*centaur) |
|---|
| 327 | | - + (states + 1) * sizeof(struct cpufreq_frequency_table), |
|---|
| 328 | | - GFP_KERNEL); |
|---|
| 324 | + centaur = kzalloc(struct_size(centaur, freq_table, states + 1), |
|---|
| 325 | + GFP_KERNEL); |
|---|
| 329 | 326 | if (!centaur) |
|---|
| 330 | 327 | return -ENOMEM; |
|---|
| 331 | 328 | eps_cpu[0] = centaur; |
|---|
| .. | .. |
|---|
| 387 | 384 | /* This driver will work only on Centaur C7 processors with |
|---|
| 388 | 385 | * Enhanced SpeedStep/PowerSaver registers */ |
|---|
| 389 | 386 | static const struct x86_cpu_id eps_cpu_id[] = { |
|---|
| 390 | | - { X86_VENDOR_CENTAUR, 6, X86_MODEL_ANY, X86_FEATURE_EST }, |
|---|
| 387 | + X86_MATCH_VENDOR_FAM_FEATURE(CENTAUR, 6, X86_FEATURE_EST, NULL), |
|---|
| 391 | 388 | {} |
|---|
| 392 | 389 | }; |
|---|
| 393 | 390 | MODULE_DEVICE_TABLE(x86cpu, eps_cpu_id); |
|---|