All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/6] ACPI:  Clean up printing messages in some source files
@ 2021-01-20 18:56 Rafael J. Wysocki
  2021-01-20 18:57 ` [PATCH v1 1/6] ACPI: power: Clean up printing messages Rafael J. Wysocki
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2021-01-20 18:56 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Erik Kaneda

Hi,

This series cleans up messaging in some source files under drivers/acpi/
and get rids of some debug code pieces that aren't needed any more.

The primary goal here was to get rid of things like ACPI_DEBUG_PRINT()
or ACPI_EXCEPTION() from non-ACPICA code (they are specific to ACPICA and
should not be used outside of it) and allow the usual dynamic debug to
be used in the files in question instead, but also there are some
cleanups related to the raw printk() usage and so on.

Please refer to patch changelogs for details.

Thanks!




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 1/6] ACPI: power: Clean up printing messages
  2021-01-20 18:56 [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Rafael J. Wysocki
@ 2021-01-20 18:57 ` Rafael J. Wysocki
  2021-01-20 18:58 ` [PATCH v1 2/6] ACPI: PM: " Rafael J. Wysocki
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2021-01-20 18:57 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Erik Kaneda

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Replace all of the ACPI_DEBUG_PRINT() instances in power.c with
acpi_handle_debug() or pr_debug(), depending on the context,
drop the _COMPONENT and ACPI_MODULE_NAME() definitions that
are not used any more, and replace the direct invocations of
printk() in there with acpi_handle_info() or pr_info(), depending
on the context.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/power.c |   44 +++++++++++++++-----------------------------
 1 file changed, 15 insertions(+), 29 deletions(-)

Index: linux-pm/drivers/acpi/power.c
===================================================================
--- linux-pm.orig/drivers/acpi/power.c
+++ linux-pm/drivers/acpi/power.c
@@ -21,6 +21,8 @@
  * may be shared by multiple devices.
  */
 
+#define pr_fmt(fmt) "ACPI: PM: " fmt
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -32,8 +34,6 @@
 #include "sleep.h"
 #include "internal.h"
 
-#define _COMPONENT			ACPI_POWER_COMPONENT
-ACPI_MODULE_NAME("power");
 #define ACPI_POWER_CLASS		"power_resource"
 #define ACPI_POWER_DEVICE_NAME		"Power Resource"
 #define ACPI_POWER_RESOURCE_STATE_OFF	0x00
@@ -181,9 +181,6 @@ static int acpi_power_get_state(acpi_han
 {
 	acpi_status status = AE_OK;
 	unsigned long long sta = 0;
-	char node_name[5];
-	struct acpi_buffer buffer = { sizeof(node_name), node_name };
-
 
 	if (!handle || !state)
 		return -EINVAL;
@@ -195,11 +192,8 @@ static int acpi_power_get_state(acpi_han
 	*state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON:
 			      ACPI_POWER_RESOURCE_STATE_OFF;
 
-	acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
-
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
-			  node_name,
-				*state ? "on" : "off"));
+	acpi_handle_debug(handle, "Power resource is %s\n",
+			  *state ? "on" : "off");
 
 	return 0;
 }
@@ -229,8 +223,7 @@ static int acpi_power_get_list_state(str
 			break;
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n",
-			  cur_state ? "on" : "off"));
+	pr_debug("Power resource list is %s\n", cur_state ? "on" : "off");
 
 	*state = cur_state;
 	return 0;
@@ -357,8 +350,7 @@ static int __acpi_power_on(struct acpi_p
 	if (ACPI_FAILURE(status))
 		return -ENODEV;
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n",
-			  resource->name));
+	pr_debug("Power resource [%s] turned on\n", resource->name);
 
 	/*
 	 * If there are other dependents on this power resource we need to
@@ -383,9 +375,7 @@ static int acpi_power_on_unlocked(struct
 	int result = 0;
 
 	if (resource->ref_count++) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Power resource [%s] already on\n",
-				  resource->name));
+		pr_debug("Power resource [%s] already on\n", resource->name);
 	} else {
 		result = __acpi_power_on(resource);
 		if (result)
@@ -413,8 +403,8 @@ static int __acpi_power_off(struct acpi_
 	if (ACPI_FAILURE(status))
 		return -ENODEV;
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned off\n",
-			  resource->name));
+	pr_debug("Power resource [%s] turned off\n", resource->name);
+
 	return 0;
 }
 
@@ -423,16 +413,12 @@ static int acpi_power_off_unlocked(struc
 	int result = 0;
 
 	if (!resource->ref_count) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Power resource [%s] already off\n",
-				  resource->name));
+		pr_debug("Power resource [%s] already off\n", resource->name);
 		return 0;
 	}
 
 	if (--resource->ref_count) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Power resource [%s] still in use\n",
-				  resource->name));
+		pr_debug("Power resource [%s] still in use\n", resource->name);
 	} else {
 		result = __acpi_power_off(resource);
 		if (result)
@@ -672,7 +658,7 @@ int acpi_device_sleep_wake(struct acpi_d
 	if (ACPI_SUCCESS(status)) {
 		return 0;
 	} else if (status != AE_NOT_FOUND) {
-		printk(KERN_ERR PREFIX "_DSW execution failed\n");
+		acpi_handle_info(dev->handle, "_DSW execution failed\n");
 		dev->wakeup.flags.valid = 0;
 		return -ENODEV;
 	}
@@ -680,7 +666,7 @@ int acpi_device_sleep_wake(struct acpi_d
 	/* Execute _PSW */
 	status = acpi_execute_simple_method(dev->handle, "_PSW", enable);
 	if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-		printk(KERN_ERR PREFIX "_PSW execution failed\n");
+		acpi_handle_info(dev->handle, "_PSW execution failed\n");
 		dev->wakeup.flags.valid = 0;
 		return -ENODEV;
 	}
@@ -960,8 +946,8 @@ int acpi_add_power_resource(acpi_handle
 	if (result)
 		goto err;
 
-	printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device),
-	       acpi_device_bid(device), state ? "on" : "off");
+	pr_info("%s [%s] (%s)\n", acpi_device_name(device),
+		acpi_device_bid(device), state ? "on" : "off");
 
 	device->flags.match_driver = true;
 	result = acpi_device_add(device, acpi_release_power_resource);




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 2/6] ACPI: PM: Clean up printing messages
  2021-01-20 18:56 [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Rafael J. Wysocki
  2021-01-20 18:57 ` [PATCH v1 1/6] ACPI: power: Clean up printing messages Rafael J. Wysocki
@ 2021-01-20 18:58 ` Rafael J. Wysocki
  2021-01-20 18:59 ` [PATCH v1 3/6] ACPI: bus: " Rafael J. Wysocki
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2021-01-20 18:58 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Erik Kaneda

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Replace the remaining ACPI_DEBUG_PRINT() instances in device_pm.c
with dev_dbg() invocations, drop the _COMPONENT and ACPI_MODULE_NAME()
definitions that are not used any more, and drop the no longer needed
ACPI_POWER_COMPONENT definition from the headers and documentation.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 Documentation/firmware-guide/acpi/debug.rst |    1 -
 drivers/acpi/device_pm.c                    |   20 ++++++++------------
 drivers/acpi/sysfs.c                        |    1 -
 include/acpi/acpi_drivers.h                 |    1 -
 4 files changed, 8 insertions(+), 15 deletions(-)

Index: linux-pm/Documentation/firmware-guide/acpi/debug.rst
===================================================================
--- linux-pm.orig/Documentation/firmware-guide/acpi/debug.rst
+++ linux-pm/Documentation/firmware-guide/acpi/debug.rst
@@ -59,7 +59,6 @@ shows the supported mask values, current
     ACPI_SBS_COMPONENT              0x00100000
     ACPI_FAN_COMPONENT              0x00200000
     ACPI_PCI_COMPONENT              0x00400000
-    ACPI_POWER_COMPONENT            0x00800000
     ACPI_CONTAINER_COMPONENT        0x01000000
     ACPI_SYSTEM_COMPONENT           0x02000000
     ACPI_THERMAL_COMPONENT          0x04000000
Index: linux-pm/drivers/acpi/device_pm.c
===================================================================
--- linux-pm.orig/drivers/acpi/device_pm.c
+++ linux-pm/drivers/acpi/device_pm.c
@@ -10,6 +10,8 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
+#define pr_fmt(fmt) "ACPI: PM: " fmt
+
 #include <linux/acpi.h>
 #include <linux/export.h>
 #include <linux/mutex.h>
@@ -20,9 +22,6 @@
 
 #include "internal.h"
 
-#define _COMPONENT	ACPI_POWER_COMPONENT
-ACPI_MODULE_NAME("device_pm");
-
 /**
  * acpi_power_state_string - String representation of ACPI device power state.
  * @state: ACPI device power state to return the string representation of.
@@ -130,8 +129,8 @@ int acpi_device_get_power(struct acpi_de
 	*state = result;
 
  out:
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is %s\n",
-			  device->pnp.bus_id, acpi_power_state_string(*state)));
+	dev_dbg(&device->dev, "Device power state is %s\n",
+		acpi_power_state_string(*state));
 
 	return 0;
 }
@@ -174,9 +173,8 @@ int acpi_device_set_power(struct acpi_de
 
 	/* There is a special case for D0 addressed below. */
 	if (state > ACPI_STATE_D0 && state == device->power.state) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] already in %s\n",
-				  device->pnp.bus_id,
-				  acpi_power_state_string(state)));
+		dev_dbg(&device->dev, "Device already in %s\n",
+			acpi_power_state_string(state));
 		return 0;
 	}
 
@@ -276,10 +274,8 @@ int acpi_device_set_power(struct acpi_de
 			 acpi_power_state_string(target_state));
 	} else {
 		device->power.state = target_state;
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Device [%s] transitioned to %s\n",
-				  device->pnp.bus_id,
-				  acpi_power_state_string(target_state)));
+		dev_dbg(&device->dev, "Power state changed to %s\n",
+			acpi_power_state_string(target_state));
 	}
 
 	return result;
Index: linux-pm/drivers/acpi/sysfs.c
===================================================================
--- linux-pm.orig/drivers/acpi/sysfs.c
+++ linux-pm/drivers/acpi/sysfs.c
@@ -59,7 +59,6 @@ static const struct acpi_dlayer acpi_deb
 	ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT),
 	ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT),
 	ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT),
-	ACPI_DEBUG_INIT(ACPI_POWER_COMPONENT),
 	ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT),
 	ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT),
 	ACPI_DEBUG_INIT(ACPI_THERMAL_COMPONENT),
Index: linux-pm/include/acpi/acpi_drivers.h
===================================================================
--- linux-pm.orig/include/acpi/acpi_drivers.h
+++ linux-pm/include/acpi/acpi_drivers.h
@@ -22,7 +22,6 @@
 #define ACPI_SBS_COMPONENT		0x00100000
 #define ACPI_FAN_COMPONENT		0x00200000
 #define ACPI_PCI_COMPONENT		0x00400000
-#define ACPI_POWER_COMPONENT		0x00800000
 #define ACPI_CONTAINER_COMPONENT	0x01000000
 #define ACPI_SYSTEM_COMPONENT		0x02000000
 #define ACPI_THERMAL_COMPONENT		0x04000000




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 3/6] ACPI: bus: Clean up printing messages
  2021-01-20 18:56 [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Rafael J. Wysocki
  2021-01-20 18:57 ` [PATCH v1 1/6] ACPI: power: Clean up printing messages Rafael J. Wysocki
  2021-01-20 18:58 ` [PATCH v1 2/6] ACPI: PM: " Rafael J. Wysocki
@ 2021-01-20 18:59 ` Rafael J. Wysocki
  2021-01-20 18:59 ` [PATCH v1 4/6] ACPI: scan: " Rafael J. Wysocki
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2021-01-20 18:59 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Erik Kaneda

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Replace all of the ACPI_DEBUG_PRINT() and ACPI_EXCEPTION() instances
in bus.c with pr_debug() and pr_info(), respectively, drop the
_COMPONENT and ACPI_MODULE_NAME() definitions that are not used any
more and replace direct printk() invocations with the matching
pr_*() calls (with a couple of exceptions where the log level is
decreased).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/bus.c |   60 ++++++++++++++++++++++-------------------------------
 1 file changed, 26 insertions(+), 34 deletions(-)

Index: linux-pm/drivers/acpi/bus.c
===================================================================
--- linux-pm.orig/drivers/acpi/bus.c
+++ linux-pm/drivers/acpi/bus.c
@@ -5,6 +5,8 @@
  *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
  */
 
+#define pr_fmt(fmt) "ACPI: " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
@@ -31,9 +33,6 @@
 
 #include "internal.h"
 
-#define _COMPONENT		ACPI_BUS_COMPONENT
-ACPI_MODULE_NAME("bus");
-
 struct acpi_device *acpi_root;
 struct proc_dir_entry *acpi_root_dir;
 EXPORT_SYMBOL(acpi_root_dir);
@@ -47,8 +46,7 @@ static inline int set_copy_dsdt(const st
 #else
 static int set_copy_dsdt(const struct dmi_system_id *id)
 {
-	printk(KERN_NOTICE "%s detected - "
-		"force copy of DSDT to local memory\n", id->ident);
+	pr_notice("%s detected - force copy of DSDT to local memory\n", id->ident);
 	acpi_gbl_copy_dsdt_locally = 1;
 	return 0;
 }
@@ -116,13 +114,11 @@ int acpi_bus_get_status(struct acpi_devi
 	acpi_set_device_status(device, sta);
 
 	if (device->status.functional && !device->status.present) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]: "
-		       "functional but not present;\n",
-			device->pnp.bus_id, (u32)sta));
+		pr_debug("Device [%s] status [%08x]: functional but not present\n",
+			 device->pnp.bus_id, (u32)sta);
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n",
-			  device->pnp.bus_id, (u32)sta));
+	pr_debug("Device [%s] status [%08x]\n", device->pnp.bus_id, (u32)sta);
 	return 0;
 }
 EXPORT_SYMBOL(acpi_bus_get_status);
@@ -915,9 +911,9 @@ static int acpi_device_probe(struct devi
 		return ret;
 
 	acpi_dev->driver = acpi_drv;
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-			  "Driver [%s] successfully bound to device [%s]\n",
-			  acpi_drv->name, acpi_dev->pnp.bus_id));
+
+	pr_debug("Driver [%s] successfully bound to device [%s]\n",
+		 acpi_drv->name, acpi_dev->pnp.bus_id);
 
 	if (acpi_drv->ops.notify) {
 		ret = acpi_device_install_notify_handler(acpi_dev);
@@ -931,8 +927,9 @@ static int acpi_device_probe(struct devi
 		}
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found driver [%s] for device [%s]\n",
-			  acpi_drv->name, acpi_dev->pnp.bus_id));
+	pr_debug("Found driver [%s] for device [%s]\n", acpi_drv->name,
+		 acpi_dev->pnp.bus_id);
+
 	get_device(dev);
 	return 0;
 }
@@ -995,15 +992,15 @@ static int __init acpi_bus_init_irq(void
 		message = "platform specific model";
 		break;
 	default:
-		printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n");
+		pr_info("Unknown interrupt routing model\n");
 		return -ENODEV;
 	}
 
-	printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message);
+	pr_info("Using %s for interrupt routing\n", message);
 
 	status = acpi_execute_simple_method(NULL, "\\_PIC", acpi_irq_model);
 	if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-		ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC"));
+		pr_info("_PIC evaluation failed: %s\n", acpi_format_exception(status));
 		return -ENODEV;
 	}
 
@@ -1027,7 +1024,7 @@ void __init acpi_early_init(void)
 	if (acpi_disabled)
 		return;
 
-	printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
+	pr_info("Core revision %08x\n", ACPI_CA_VERSION);
 
 	/* enable workarounds, unless strict ACPI spec. compliance */
 	if (!acpi_strict)
@@ -1048,15 +1045,13 @@ void __init acpi_early_init(void)
 
 	status = acpi_reallocate_root_table();
 	if (ACPI_FAILURE(status)) {
-		printk(KERN_ERR PREFIX
-		       "Unable to reallocate ACPI tables\n");
+		pr_err("Unable to reallocate ACPI tables\n");
 		goto error0;
 	}
 
 	status = acpi_initialize_subsystem();
 	if (ACPI_FAILURE(status)) {
-		printk(KERN_ERR PREFIX
-		       "Unable to initialize the ACPI Interpreter\n");
+		pr_err("Unable to initialize the ACPI Interpreter\n");
 		goto error0;
 	}
 
@@ -1102,7 +1097,7 @@ void __init acpi_subsystem_init(void)
 
 	status = acpi_enable_subsystem(~ACPI_NO_ACPI_ENABLE);
 	if (ACPI_FAILURE(status)) {
-		printk(KERN_ERR PREFIX "Unable to enable ACPI\n");
+		pr_err("Unable to enable ACPI\n");
 		disable_acpi();
 	} else {
 		/*
@@ -1131,8 +1126,7 @@ static int __init acpi_bus_init(void)
 
 	status = acpi_load_tables();
 	if (ACPI_FAILURE(status)) {
-		printk(KERN_ERR PREFIX
-		       "Unable to load the System Description Tables\n");
+		pr_err("Unable to load the System Description Tables\n");
 		goto error1;
 	}
 
@@ -1150,14 +1144,13 @@ static int __init acpi_bus_init(void)
 
 	status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
 	if (ACPI_FAILURE(status)) {
-		printk(KERN_ERR PREFIX
-		       "Unable to start the ACPI Interpreter\n");
+		pr_err("Unable to start the ACPI Interpreter\n");
 		goto error1;
 	}
 
 	status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
 	if (ACPI_FAILURE(status)) {
-		printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n");
+		pr_err("Unable to initialize ACPI objects\n");
 		goto error1;
 	}
 
@@ -1186,7 +1179,7 @@ static int __init acpi_bus_init(void)
 	 */
 	acpi_ec_dsdt_probe();
 
-	printk(KERN_INFO PREFIX "Interpreter enabled\n");
+	pr_info("Interpreter enabled\n");
 
 	/* Initialize sleep structures */
 	acpi_sleep_init();
@@ -1205,8 +1198,7 @@ static int __init acpi_bus_init(void)
 	    acpi_install_notify_handler(ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY,
 					&acpi_bus_notify, NULL);
 	if (ACPI_FAILURE(status)) {
-		printk(KERN_ERR PREFIX
-		       "Unable to register for device notifications\n");
+		pr_err("Unable to register for system notifications\n");
 		goto error1;
 	}
 
@@ -1233,13 +1225,13 @@ static int __init acpi_init(void)
 	int result;
 
 	if (acpi_disabled) {
-		printk(KERN_INFO PREFIX "Interpreter disabled.\n");
+		pr_info("Interpreter disabled.\n");
 		return -ENODEV;
 	}
 
 	acpi_kobj = kobject_create_and_add("acpi", firmware_kobj);
 	if (!acpi_kobj) {
-		printk(KERN_WARNING "%s: kset create error\n", __func__);
+		pr_debug("%s: kset create error\n", __func__);
 		acpi_kobj = NULL;
 	}
 




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 4/6] ACPI: scan: Clean up printing messages
  2021-01-20 18:56 [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Rafael J. Wysocki
                   ` (2 preceding siblings ...)
  2021-01-20 18:59 ` [PATCH v1 3/6] ACPI: bus: " Rafael J. Wysocki
@ 2021-01-20 18:59 ` Rafael J. Wysocki
  2021-01-21 21:24     ` kernel test robot
  2021-01-20 19:00 ` [PATCH v1 5/6] ACPI: utils: " Rafael J. Wysocki
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2021-01-20 18:59 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Erik Kaneda

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Replace all of the ACPI_DEBUG_PRINT() and ACPI_EXCEPTION() instances
in scan.c with acpi_handle_debug() and acpi_handle_info(), respectively,
and drop the _COMPONENT and ACPI_MODULE_NAME() definitions that
are not used any more.

While at it, drop the redundant "Memory allocation error" message
from acpi_add_single_object() and clean up the list of local variables
in that function.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/scan.c |   29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -19,8 +19,6 @@
 
 #include "internal.h"
 
-#define _COMPONENT		ACPI_BUS_COMPONENT
-ACPI_MODULE_NAME("scan");
 extern struct acpi_device *acpi_root;
 
 #define ACPI_BUS_CLASS			"system_bus"
@@ -265,8 +263,7 @@ static int acpi_scan_hot_remove(struct a
 			return error;
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-		"Hot-removing device %s...\n", dev_name(&device->dev)));
+	acpi_handle_debug(handle, "Ejecting\n");
 
 	acpi_bus_trim(device);
 
@@ -827,7 +824,8 @@ static int acpi_bus_extract_wakeup_devic
 	/* _PRW */
 	status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer);
 	if (ACPI_FAILURE(status)) {
-		ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));
+		acpi_handle_info(handle, "_PRW evaluation failed: %s\n",
+				 acpi_format_exception(status));
 		return err;
 	}
 
@@ -932,7 +930,7 @@ static void acpi_bus_get_wakeup_device_f
 
 	err = acpi_bus_extract_wakeup_device_power_package(device);
 	if (err) {
-		dev_err(&device->dev, "_PRW evaluation error: %d\n", err);
+		dev_err(&device->dev, "Unable to extract wakeup power resources");
 		return;
 	}
 
@@ -1168,8 +1166,7 @@ acpi_backlight_cap_match(acpi_handle han
 
 	if (acpi_has_method(handle, "_BCM") &&
 	    acpi_has_method(handle, "_BCL")) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight "
-				  "support\n"));
+		acpi_handle_debug(handle, "Found generic backlight support\n");
 		*cap |= ACPI_VIDEO_BACKLIGHT;
 		/* We have backlight support, no need to scan further */
 		return AE_CTRL_TERMINATE;
@@ -1660,17 +1657,15 @@ static int acpi_add_single_object(struct
 				  acpi_handle handle, int type,
 				  unsigned long long sta)
 {
-	int result;
-	struct acpi_device *device;
-	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 	struct acpi_device_info *info = NULL;
+	struct acpi_device *device;
+	int result;
 
 	if (handle != ACPI_ROOT_OBJECT && type == ACPI_BUS_TYPE_DEVICE)
 		acpi_get_object_info(handle, &info);
 
 	device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL);
 	if (!device) {
-		printk(KERN_ERR PREFIX "Memory allocation error\n");
 		kfree(info);
 		return -ENOMEM;
 	}
@@ -1697,11 +1692,11 @@ static int acpi_add_single_object(struct
 
 	acpi_power_add_remove_device(device, true);
 	acpi_device_add_finalize(device);
-	acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Added %s [%s] parent %s\n",
-		dev_name(&device->dev), (char *) buffer.pointer,
-		device->parent ? dev_name(&device->parent->dev) : "(null)"));
-	kfree(buffer.pointer);
+
+	acpi_handle_debug(handle, "Added as %s, parent %s\n",
+			  dev_name(&device->dev), device->parent ?
+				dev_name(&device->parent->dev) : "(null)");
+
 	*child = device;
 	return 0;
 }




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 5/6] ACPI: utils: Clean up printing messages
  2021-01-20 18:56 [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Rafael J. Wysocki
                   ` (3 preceding siblings ...)
  2021-01-20 18:59 ` [PATCH v1 4/6] ACPI: scan: " Rafael J. Wysocki
@ 2021-01-20 19:00 ` Rafael J. Wysocki
  2021-01-20 19:01 ` [PATCH v1 6/6] ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more Rafael J. Wysocki
  2021-01-20 20:09 ` [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Joe Perches
  6 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2021-01-20 19:00 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Erik Kaneda

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Replace all of the ACPI_DEBUG_PRINT() instances in utils.c with
pr_debug() and acpi_handle_debug(), drop the _COMPONENT and
ACPI_MODULE_NAME() definitions that are not used any more and
replace direct printk() invocations with pr_debug() calls (the log
level in there is way excessive).

Also add a special pr_fmt() definition, but this only affects the
pr_debug() messages mentioned above.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/utils.c |   56 ++++++++++++++++-----------------------------------
 1 file changed, 18 insertions(+), 38 deletions(-)

Index: linux-pm/drivers/acpi/utils.c
===================================================================
--- linux-pm.orig/drivers/acpi/utils.c
+++ linux-pm/drivers/acpi/utils.c
@@ -6,6 +6,8 @@
  *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
  */
 
+#define pr_fmt(fmt) "ACPI: utils: " fmt
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -18,24 +20,12 @@
 #include "internal.h"
 #include "sleep.h"
 
-#define _COMPONENT		ACPI_BUS_COMPONENT
-ACPI_MODULE_NAME("utils");
-
 /* --------------------------------------------------------------------------
                             Object Evaluation Helpers
    -------------------------------------------------------------------------- */
-static void
-acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s)
+static void acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s)
 {
-#ifdef ACPI_DEBUG_OUTPUT
-	char prefix[80] = {'\0'};
-	struct acpi_buffer buffer = {sizeof(prefix), prefix};
-	acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate [%s.%s]: %s\n",
-		(char *) prefix, p, acpi_format_exception(s)));
-#else
-	return;
-#endif
+	acpi_handle_debug(h, "Evaluate [%s]: %s\n", p, acpi_format_exception(s));
 }
 
 acpi_status
@@ -53,25 +43,24 @@ acpi_extract_package(union acpi_object *
 
 	if (!package || (package->type != ACPI_TYPE_PACKAGE)
 	    || (package->package.count < 1)) {
-		printk(KERN_WARNING PREFIX "Invalid package argument\n");
+		pr_debug("Invalid package argument\n");
 		return AE_BAD_PARAMETER;
 	}
 
 	if (!format || !format->pointer || (format->length < 1)) {
-		printk(KERN_WARNING PREFIX "Invalid format argument\n");
+		pr_debug("Invalid format argument\n");
 		return AE_BAD_PARAMETER;
 	}
 
 	if (!buffer) {
-		printk(KERN_WARNING PREFIX "Invalid buffer argument\n");
+		pr_debug("Invalid buffer argument\n");
 		return AE_BAD_PARAMETER;
 	}
 
 	format_count = (format->length / sizeof(char)) - 1;
 	if (format_count > package->package.count) {
-		printk(KERN_WARNING PREFIX "Format specifies more objects [%d]"
-			      " than exist in package [%d].\n",
-			      format_count, package->package.count);
+		pr_debug("Format specifies more objects [%d] than present [%d]\n",
+			 format_count, package->package.count);
 		return AE_BAD_DATA;
 	}
 
@@ -99,10 +88,8 @@ acpi_extract_package(union acpi_object *
 				tail_offset += sizeof(char *);
 				break;
 			default:
-				printk(KERN_WARNING PREFIX "Invalid package element"
-					      " [%d]: got number, expecting"
-					      " [%c]\n",
-					      i, format_string[i]);
+				pr_debug("Invalid package element [%d]: got number, expected [%c]\n",
+					 i, format_string[i]);
 				return AE_BAD_DATA;
 			}
 			break;
@@ -123,10 +110,8 @@ acpi_extract_package(union acpi_object *
 				tail_offset += sizeof(u8 *);
 				break;
 			default:
-				printk(KERN_WARNING PREFIX "Invalid package element"
-					      " [%d] got string/buffer,"
-					      " expecting [%c]\n",
-					      i, format_string[i]);
+				pr_debug("Invalid package element [%d] got string/buffer, expected [%c]\n",
+					 i, format_string[i]);
 				return AE_BAD_DATA;
 			}
 			break;
@@ -137,19 +122,15 @@ acpi_extract_package(union acpi_object *
 				tail_offset += sizeof(void *);
 				break;
 			default:
-				printk(KERN_WARNING PREFIX "Invalid package element"
-					      " [%d] got reference,"
-					      " expecting [%c]\n",
-					      i, format_string[i]);
+				pr_debug("Invalid package element [%d] got reference, expected [%c]\n",
+					 i, format_string[i]);
 				return AE_BAD_DATA;
 			}
 			break;
 
 		case ACPI_TYPE_PACKAGE:
 		default:
-			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-					  "Found unsupported element at index=%d\n",
-					  i));
+			pr_debug("Unsupported element at index=%d\n", i);
 			/* TBD: handle nested packages... */
 			return AE_SUPPORT;
 		}
@@ -289,7 +270,7 @@ acpi_evaluate_integer(acpi_handle handle
 
 	*data = element.integer.value;
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data));
+	acpi_handle_debug(handle, "Return value [%llu]\n", *data);
 
 	return AE_OK;
 }
@@ -363,8 +344,7 @@ acpi_evaluate_reference(acpi_handle hand
 		/* Get the  acpi_handle. */
 
 		list->handles[i] = element->reference.handle;
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found reference [%p]\n",
-				  list->handles[i]));
+		acpi_handle_debug(list->handles[i], "Found in reference list\n");
 	}
 
       end:




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v1 6/6] ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more
  2021-01-20 18:56 [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Rafael J. Wysocki
                   ` (4 preceding siblings ...)
  2021-01-20 19:00 ` [PATCH v1 5/6] ACPI: utils: " Rafael J. Wysocki
@ 2021-01-20 19:01 ` Rafael J. Wysocki
  2021-01-20 20:09 ` [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Joe Perches
  6 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2021-01-20 19:01 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Erik Kaneda

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

After dropping all of the code using ACPI_BUS_COMPONENT drop it
too and modify the example in the documentation using it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 Documentation/firmware-guide/acpi/debug.rst |   13 ++++++-------
 drivers/acpi/sysfs.c                        |    1 -
 include/acpi/acpi_drivers.h                 |    1 -
 3 files changed, 6 insertions(+), 9 deletions(-)

Index: linux-pm/Documentation/firmware-guide/acpi/debug.rst
===================================================================
--- linux-pm.orig/Documentation/firmware-guide/acpi/debug.rst
+++ linux-pm/Documentation/firmware-guide/acpi/debug.rst
@@ -52,7 +52,6 @@ shows the supported mask values, current
     ACPI_CA_DISASSEMBLER            0x00000800
     ACPI_COMPILER                   0x00001000
     ACPI_TOOLS                      0x00002000
-    ACPI_BUS_COMPONENT              0x00010000
     ACPI_AC_COMPONENT               0x00020000
     ACPI_BATTERY_COMPONENT          0x00040000
     ACPI_BUTTON_COMPONENT           0x00080000
@@ -117,15 +116,15 @@ currently these::
 Examples
 ========
 
-For example, drivers/acpi/bus.c contains this::
+For example, drivers/acpi/acpica/evxfevnt.c contains this::
 
-    #define _COMPONENT              ACPI_BUS_COMPONENT
+    #define _COMPONENT          ACPI_EVENTS
     ...
-    ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device insertion detected\n"));
+    ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI mode disabled\n"));
 
-To turn on this message, set the ACPI_BUS_COMPONENT bit in acpi.debug_layer
-and the ACPI_LV_INFO bit in acpi.debug_level.  (The ACPI_DEBUG_PRINT
-statement uses ACPI_DB_INFO, which is macro based on the ACPI_LV_INFO
+To turn on this message, set the ACPI_EVENTS bit in acpi.debug_layer
+and the ACPI_LV_INIT bit in acpi.debug_level.  (The ACPI_DEBUG_PRINT
+statement uses ACPI_DB_INIT, which is a macro based on the ACPI_LV_INIT
 definition.)
 
 Enable all AML "Debug" output (stores to the Debug object while interpreting
Index: linux-pm/drivers/acpi/sysfs.c
===================================================================
--- linux-pm.orig/drivers/acpi/sysfs.c
+++ linux-pm/drivers/acpi/sysfs.c
@@ -52,7 +52,6 @@ static const struct acpi_dlayer acpi_deb
 	ACPI_DEBUG_INIT(ACPI_COMPILER),
 	ACPI_DEBUG_INIT(ACPI_TOOLS),
 
-	ACPI_DEBUG_INIT(ACPI_BUS_COMPONENT),
 	ACPI_DEBUG_INIT(ACPI_AC_COMPONENT),
 	ACPI_DEBUG_INIT(ACPI_BATTERY_COMPONENT),
 	ACPI_DEBUG_INIT(ACPI_BUTTON_COMPONENT),
Index: linux-pm/include/acpi/acpi_drivers.h
===================================================================
--- linux-pm.orig/include/acpi/acpi_drivers.h
+++ linux-pm/include/acpi/acpi_drivers.h
@@ -15,7 +15,6 @@
  * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst
  * if you add to this list.
  */
-#define ACPI_BUS_COMPONENT		0x00010000
 #define ACPI_AC_COMPONENT		0x00020000
 #define ACPI_BATTERY_COMPONENT		0x00040000
 #define ACPI_BUTTON_COMPONENT		0x00080000




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 0/6] ACPI:  Clean up printing messages in some source files
  2021-01-20 18:56 [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Rafael J. Wysocki
                   ` (5 preceding siblings ...)
  2021-01-20 19:01 ` [PATCH v1 6/6] ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more Rafael J. Wysocki
@ 2021-01-20 20:09 ` Joe Perches
  6 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2021-01-20 20:09 UTC (permalink / raw)
  To: Rafael J. Wysocki, Linux ACPI; +Cc: LKML, Erik Kaneda

On Wed, 2021-01-20 at 19:56 +0100, Rafael J. Wysocki wrote:
> This series cleans up messaging in some source files under drivers/acpi/
> and get rids of some debug code pieces that aren't needed any more.

Thanks Rafael.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 4/6] ACPI: scan: Clean up printing messages
  2021-01-20 18:59 ` [PATCH v1 4/6] ACPI: scan: " Rafael J. Wysocki
@ 2021-01-21 21:24     ` kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-01-21 21:24 UTC (permalink / raw)
  To: Rafael J. Wysocki, Linux ACPI; +Cc: kbuild-all, LKML, Erik Kaneda

[-- Attachment #1: Type: text/plain, Size: 7776 bytes --]

Hi "Rafael,

I love your patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[also build test ERROR on linux/master linus/master v5.11-rc4 next-20210121]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Rafael-J-Wysocki/ACPI-Clean-up-printing-messages-in-some-source-files/20210121-030855
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/c8724c26fcedf4a30fdfa9213c38a2f94c4bc0ef
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Rafael-J-Wysocki/ACPI-Clean-up-printing-messages-in-some-source-files/20210121-030855
        git checkout c8724c26fcedf4a30fdfa9213c38a2f94c4bc0ef
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/acpi/acpi.h:29,
                    from include/linux/acpi.h:22,
                    from drivers/acpi/scan.c:10:
   drivers/acpi/scan.c: In function 'acpi_get_device_data':
>> include/acpi/acoutput.h:258:55: error: '_COMPONENT' undeclared (first use in this function)
     258 |  __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
         |                                                       ^~~~~~~~~~
   include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0'
     281 | #define ACPI_DO_WHILE0(a)               do a while(0)
         |                                            ^
   include/acpi/acoutput.h:299:7: note: in expansion of macro 'ACPI_IS_DEBUG_ENABLED'
     299 |   if (ACPI_IS_DEBUG_ENABLED (level, component)) \
         |       ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:306:2: note: in expansion of macro 'ACPI_DO_DEBUG_PRINT'
     306 |  ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \
         |  ^~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:313:41: note: in expansion of macro 'ACPI_ACTUAL_DEBUG'
     313 | #define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist
         |                                         ^~~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:3: note: in expansion of macro 'ACPI_DEBUG_PRINT'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |   ^~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:107:46: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS'
     107 | #define ACPI_DEBUG_LEVEL(dl)        (u32) dl,ACPI_DEBUG_PARAMETERS
         |                                              ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:117:37: note: in expansion of macro 'ACPI_DEBUG_LEVEL'
     117 | #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
         |                                     ^~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:21: note: in expansion of macro 'ACPI_DB_INFO'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |                     ^~~~~~~~~~~~
   include/acpi/acoutput.h:258:55: note: each undeclared identifier is reported only once for each function it appears in
     258 |  __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
         |                                                       ^~~~~~~~~~
   include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0'
     281 | #define ACPI_DO_WHILE0(a)               do a while(0)
         |                                            ^
   include/acpi/acoutput.h:299:7: note: in expansion of macro 'ACPI_IS_DEBUG_ENABLED'
     299 |   if (ACPI_IS_DEBUG_ENABLED (level, component)) \
         |       ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:306:2: note: in expansion of macro 'ACPI_DO_DEBUG_PRINT'
     306 |  ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \
         |  ^~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:313:41: note: in expansion of macro 'ACPI_ACTUAL_DEBUG'
     313 | #define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist
         |                                         ^~~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:3: note: in expansion of macro 'ACPI_DEBUG_PRINT'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |   ^~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:107:46: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS'
     107 | #define ACPI_DEBUG_LEVEL(dl)        (u32) dl,ACPI_DEBUG_PARAMETERS
         |                                              ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:117:37: note: in expansion of macro 'ACPI_DEBUG_LEVEL'
     117 | #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
         |                                     ^~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:21: note: in expansion of macro 'ACPI_DB_INFO'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |                     ^~~~~~~~~~~~
>> include/acpi/acoutput.h:258:36: error: '_acpi_module_name' undeclared (first use in this function); did you mean 'quota_module_name'?
     258 |  __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
         |                                    ^~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0'
     281 | #define ACPI_DO_WHILE0(a)               do a while(0)
         |                                            ^
   include/acpi/acoutput.h:306:2: note: in expansion of macro 'ACPI_DO_DEBUG_PRINT'
     306 |  ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \
         |  ^~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:313:41: note: in expansion of macro 'ACPI_ACTUAL_DEBUG'
     313 | #define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist
         |                                         ^~~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:3: note: in expansion of macro 'ACPI_DEBUG_PRINT'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |   ^~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:107:46: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS'
     107 | #define ACPI_DEBUG_LEVEL(dl)        (u32) dl,ACPI_DEBUG_PARAMETERS
         |                                              ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:117:37: note: in expansion of macro 'ACPI_DEBUG_LEVEL'
     117 | #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
         |                                     ^~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:21: note: in expansion of macro 'ACPI_DB_INFO'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |                     ^~~~~~~~~~~~


vim +/_COMPONENT +258 include/acpi/acoutput.h

50df4d8b0f6e1971 Bob Moore 2008-12-31  252  
50df4d8b0f6e1971 Bob Moore 2008-12-31  253  /*
50df4d8b0f6e1971 Bob Moore 2008-12-31  254   * Common parameters used for debug output functions:
50df4d8b0f6e1971 Bob Moore 2008-12-31  255   * line number, function name, module(file) name, component ID
50df4d8b0f6e1971 Bob Moore 2008-12-31  256   */
ad5a06f296976305 Bob Moore 2012-12-31  257  #define ACPI_DEBUG_PARAMETERS \
ad5a06f296976305 Bob Moore 2012-12-31 @258  	__LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
50df4d8b0f6e1971 Bob Moore 2008-12-31  259  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45928 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 4/6] ACPI: scan: Clean up printing messages
@ 2021-01-21 21:24     ` kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-01-21 21:24 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7903 bytes --]

Hi "Rafael,

I love your patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[also build test ERROR on linux/master linus/master v5.11-rc4 next-20210121]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Rafael-J-Wysocki/ACPI-Clean-up-printing-messages-in-some-source-files/20210121-030855
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/c8724c26fcedf4a30fdfa9213c38a2f94c4bc0ef
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Rafael-J-Wysocki/ACPI-Clean-up-printing-messages-in-some-source-files/20210121-030855
        git checkout c8724c26fcedf4a30fdfa9213c38a2f94c4bc0ef
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/acpi/acpi.h:29,
                    from include/linux/acpi.h:22,
                    from drivers/acpi/scan.c:10:
   drivers/acpi/scan.c: In function 'acpi_get_device_data':
>> include/acpi/acoutput.h:258:55: error: '_COMPONENT' undeclared (first use in this function)
     258 |  __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
         |                                                       ^~~~~~~~~~
   include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0'
     281 | #define ACPI_DO_WHILE0(a)               do a while(0)
         |                                            ^
   include/acpi/acoutput.h:299:7: note: in expansion of macro 'ACPI_IS_DEBUG_ENABLED'
     299 |   if (ACPI_IS_DEBUG_ENABLED (level, component)) \
         |       ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:306:2: note: in expansion of macro 'ACPI_DO_DEBUG_PRINT'
     306 |  ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \
         |  ^~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:313:41: note: in expansion of macro 'ACPI_ACTUAL_DEBUG'
     313 | #define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist
         |                                         ^~~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:3: note: in expansion of macro 'ACPI_DEBUG_PRINT'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |   ^~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:107:46: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS'
     107 | #define ACPI_DEBUG_LEVEL(dl)        (u32) dl,ACPI_DEBUG_PARAMETERS
         |                                              ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:117:37: note: in expansion of macro 'ACPI_DEBUG_LEVEL'
     117 | #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
         |                                     ^~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:21: note: in expansion of macro 'ACPI_DB_INFO'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |                     ^~~~~~~~~~~~
   include/acpi/acoutput.h:258:55: note: each undeclared identifier is reported only once for each function it appears in
     258 |  __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
         |                                                       ^~~~~~~~~~
   include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0'
     281 | #define ACPI_DO_WHILE0(a)               do a while(0)
         |                                            ^
   include/acpi/acoutput.h:299:7: note: in expansion of macro 'ACPI_IS_DEBUG_ENABLED'
     299 |   if (ACPI_IS_DEBUG_ENABLED (level, component)) \
         |       ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:306:2: note: in expansion of macro 'ACPI_DO_DEBUG_PRINT'
     306 |  ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \
         |  ^~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:313:41: note: in expansion of macro 'ACPI_ACTUAL_DEBUG'
     313 | #define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist
         |                                         ^~~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:3: note: in expansion of macro 'ACPI_DEBUG_PRINT'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |   ^~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:107:46: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS'
     107 | #define ACPI_DEBUG_LEVEL(dl)        (u32) dl,ACPI_DEBUG_PARAMETERS
         |                                              ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:117:37: note: in expansion of macro 'ACPI_DEBUG_LEVEL'
     117 | #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
         |                                     ^~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:21: note: in expansion of macro 'ACPI_DB_INFO'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |                     ^~~~~~~~~~~~
>> include/acpi/acoutput.h:258:36: error: '_acpi_module_name' undeclared (first use in this function); did you mean 'quota_module_name'?
     258 |  __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
         |                                    ^~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0'
     281 | #define ACPI_DO_WHILE0(a)               do a while(0)
         |                                            ^
   include/acpi/acoutput.h:306:2: note: in expansion of macro 'ACPI_DO_DEBUG_PRINT'
     306 |  ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \
         |  ^~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:313:41: note: in expansion of macro 'ACPI_ACTUAL_DEBUG'
     313 | #define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist
         |                                         ^~~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:3: note: in expansion of macro 'ACPI_DEBUG_PRINT'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |   ^~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:107:46: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS'
     107 | #define ACPI_DEBUG_LEVEL(dl)        (u32) dl,ACPI_DEBUG_PARAMETERS
         |                                              ^~~~~~~~~~~~~~~~~~~~~
   include/acpi/acoutput.h:117:37: note: in expansion of macro 'ACPI_DEBUG_LEVEL'
     117 | #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
         |                                     ^~~~~~~~~~~~~~~~
   drivers/acpi/scan.c:591:21: note: in expansion of macro 'ACPI_DB_INFO'
     591 |   ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
         |                     ^~~~~~~~~~~~


vim +/_COMPONENT +258 include/acpi/acoutput.h

50df4d8b0f6e1971 Bob Moore 2008-12-31  252  
50df4d8b0f6e1971 Bob Moore 2008-12-31  253  /*
50df4d8b0f6e1971 Bob Moore 2008-12-31  254   * Common parameters used for debug output functions:
50df4d8b0f6e1971 Bob Moore 2008-12-31  255   * line number, function name, module(file) name, component ID
50df4d8b0f6e1971 Bob Moore 2008-12-31  256   */
ad5a06f296976305 Bob Moore 2012-12-31  257  #define ACPI_DEBUG_PARAMETERS \
ad5a06f296976305 Bob Moore 2012-12-31 @258  	__LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
50df4d8b0f6e1971 Bob Moore 2008-12-31  259  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 45928 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-21 21:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 18:56 [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Rafael J. Wysocki
2021-01-20 18:57 ` [PATCH v1 1/6] ACPI: power: Clean up printing messages Rafael J. Wysocki
2021-01-20 18:58 ` [PATCH v1 2/6] ACPI: PM: " Rafael J. Wysocki
2021-01-20 18:59 ` [PATCH v1 3/6] ACPI: bus: " Rafael J. Wysocki
2021-01-20 18:59 ` [PATCH v1 4/6] ACPI: scan: " Rafael J. Wysocki
2021-01-21 21:24   ` kernel test robot
2021-01-21 21:24     ` kernel test robot
2021-01-20 19:00 ` [PATCH v1 5/6] ACPI: utils: " Rafael J. Wysocki
2021-01-20 19:01 ` [PATCH v1 6/6] ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more Rafael J. Wysocki
2021-01-20 20:09 ` [PATCH v1 0/6] ACPI: Clean up printing messages in some source files Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.