Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: processor_perflib: Cleanup print messages

The log messages in processor_perflib.c is not in consistency,
we have some printk() calls with PREFIX, but some are not; we
use pr_*() functions without prefix. So add pr_fmt() and unify
them with pr_*() functions.

While at it, fix some obvious coding style issues when going
through the functions.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Hanjun Guo and committed by
Rafael J. Wysocki
6183a684 673a0796

+18 -20
+18 -20
drivers/acpi/processor_perflib.c
··· 9 9 * - Added processor hotplug support 10 10 */ 11 11 12 + #define pr_fmt(fmt) "ACPI: " fmt 13 + 12 14 #include <linux/kernel.h> 13 15 #include <linux/module.h> 14 16 #include <linux/init.h> ··· 21 19 #ifdef CONFIG_X86 22 20 #include <asm/cpufeature.h> 23 21 #endif 24 - 25 - #define PREFIX "ACPI: " 26 22 27 23 #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" 28 24 ··· 194 194 union acpi_object *pct = NULL; 195 195 union acpi_object obj = { 0 }; 196 196 197 - 198 197 status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); 199 198 if (ACPI_FAILURE(status)) { 200 199 acpi_evaluation_failure_warn(pr->handle, "_PCT", status); ··· 203 204 pct = (union acpi_object *)buffer.pointer; 204 205 if (!pct || (pct->type != ACPI_TYPE_PACKAGE) 205 206 || (pct->package.count != 2)) { 206 - printk(KERN_ERR PREFIX "Invalid _PCT data\n"); 207 + pr_err("Invalid _PCT data\n"); 207 208 result = -EFAULT; 208 209 goto end; 209 210 } ··· 217 218 if ((obj.type != ACPI_TYPE_BUFFER) 218 219 || (obj.buffer.length < sizeof(struct acpi_pct_register)) 219 220 || (obj.buffer.pointer == NULL)) { 220 - printk(KERN_ERR PREFIX "Invalid _PCT data (control_register)\n"); 221 + pr_err("Invalid _PCT data (control_register)\n"); 221 222 result = -EFAULT; 222 223 goto end; 223 224 } ··· 233 234 if ((obj.type != ACPI_TYPE_BUFFER) 234 235 || (obj.buffer.length < sizeof(struct acpi_pct_register)) 235 236 || (obj.buffer.pointer == NULL)) { 236 - printk(KERN_ERR PREFIX "Invalid _PCT data (status_register)\n"); 237 + pr_err("Invalid _PCT data (status_register)\n"); 237 238 result = -EFAULT; 238 239 goto end; 239 240 } ··· 241 242 memcpy(&pr->performance->status_register, obj.buffer.pointer, 242 243 sizeof(struct acpi_pct_register)); 243 244 244 - end: 245 + end: 245 246 kfree(buffer.pointer); 246 247 247 248 return result; ··· 293 294 int i; 294 295 int last_invalid = -1; 295 296 296 - 297 297 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); 298 298 if (ACPI_FAILURE(status)) { 299 299 acpi_evaluation_failure_warn(pr->handle, "_PSS", status); ··· 301 303 302 304 pss = buffer.pointer; 303 305 if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) { 304 - printk(KERN_ERR PREFIX "Invalid _PSS data\n"); 306 + pr_err("Invalid _PSS data\n"); 305 307 result = -EFAULT; 306 308 goto end; 307 309 } ··· 355 357 if (!px->core_frequency || 356 358 ((u32)(px->core_frequency * 1000) != 357 359 (px->core_frequency * 1000))) { 358 - printk(KERN_ERR FW_BUG PREFIX 360 + pr_err(FW_BUG 359 361 "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n", 360 362 pr->id, px->core_frequency); 361 363 if (last_invalid == -1) ··· 373 375 } 374 376 375 377 if (last_invalid == 0) { 376 - printk(KERN_ERR FW_BUG PREFIX 377 - "No valid BIOS _PSS frequency found for processor %d\n", pr->id); 378 + pr_err(FW_BUG 379 + "No valid BIOS _PSS frequency found for processor %d\n", pr->id); 378 380 result = -EFAULT; 379 381 kfree(pr->performance->states); 380 382 pr->performance->states = NULL; ··· 383 385 if (last_invalid > 0) 384 386 pr->performance->state_count = last_invalid; 385 387 386 - end: 388 + end: 387 389 kfree(buffer.pointer); 388 390 389 391 return result; ··· 424 426 #ifdef CONFIG_X86 425 427 if (acpi_has_method(pr->handle, "_PPC")) { 426 428 if(boot_cpu_has(X86_FEATURE_EST)) 427 - printk(KERN_WARNING FW_BUG "BIOS needs update for CPU " 429 + pr_warn(FW_BUG "BIOS needs update for CPU " 428 430 "frequency support\n"); 429 431 } 430 432 #endif ··· 518 520 519 521 psd = buffer.pointer; 520 522 if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) { 521 - printk(KERN_ERR PREFIX "Invalid _PSD data\n"); 523 + pr_err("Invalid _PSD data\n"); 522 524 result = -EFAULT; 523 525 goto end; 524 526 } 525 527 526 528 if (psd->package.count != 1) { 527 - printk(KERN_ERR PREFIX "Invalid _PSD data\n"); 529 + pr_err("Invalid _PSD data\n"); 528 530 result = -EFAULT; 529 531 goto end; 530 532 } ··· 535 537 status = acpi_extract_package(&(psd->package.elements[0]), 536 538 &format, &state); 537 539 if (ACPI_FAILURE(status)) { 538 - printk(KERN_ERR PREFIX "Invalid _PSD data\n"); 540 + pr_err("Invalid _PSD data\n"); 539 541 result = -EFAULT; 540 542 goto end; 541 543 } 542 544 543 545 if (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) { 544 - printk(KERN_ERR PREFIX "Unknown _PSD:num_entries\n"); 546 + pr_err("Unknown _PSD:num_entries\n"); 545 547 result = -EFAULT; 546 548 goto end; 547 549 } 548 550 549 551 if (pdomain->revision != ACPI_PSD_REV0_REVISION) { 550 - printk(KERN_ERR PREFIX "Unknown _PSD:revision\n"); 552 + pr_err("Unknown _PSD:revision\n"); 551 553 result = -EFAULT; 552 554 goto end; 553 555 } ··· 555 557 if (pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ALL && 556 558 pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ANY && 557 559 pdomain->coord_type != DOMAIN_COORD_TYPE_HW_ALL) { 558 - printk(KERN_ERR PREFIX "Invalid _PSD:coord_type\n"); 560 + pr_err("Invalid _PSD:coord_type\n"); 559 561 result = -EFAULT; 560 562 goto end; 561 563 }