Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp459305pxb; Wed, 20 Jan 2021 11:09:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8IC3VvC1OaW32EMHR6ZgltcDSw+K472M6CiVOH8d5I5C8t8xWYZG1Knk7fkfvjqScWk3c X-Received: by 2002:a17:906:b0c2:: with SMTP id bk2mr7258810ejb.223.1611169781053; Wed, 20 Jan 2021 11:09:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611169781; cv=none; d=google.com; s=arc-20160816; b=waaZuqPwquLSbp/lbUyGwO0Vc0Yl1KMJSpAPdYyuzNJak03L/uM/lm3gaCmpsd1XCP p3nV2QjKw/B+3Aupc4xvnjBQWAXmEUHdYDz0zYpFrxEVv7owBdZSmnu6f8WDzFiGxyEo YFsom+R4eLUaQzz1df4xfRGVZGACbFKSeiRCQ/Wvk6cTwKU89NFMS4/QKBtNL/QJ5lF3 uzkeKGUAcmY/f8vchm5W4IYM4IwPdPYyW3Qrs8LNJg5fs2mEcynWUVg33tWiUbGg0vSS SQczBskfyHcPSz1CM0n9il5mWMDrUWOTxh2qhDY+6+cBgoaGt97qq9BXRHNKOLFQILxN kJvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=m7voZatcn9vMsEllXH/VcEfZ8bytEu3pjNTMjLaibrE=; b=ywPQqA+2fL/Z8om+5Ydk79VOYy0Qy8csfjK9e/ZGX+dBgaWfcJhQp9ARyrIr39FkrE I/Yy2fPRp9wAd+uXyx2FFSd7BSrfC4NEYtxnXPbEpIWvPIbruX86oOLFbTpgqi0Rb5CQ F9JJfewxMUEsAsUOPgmvbdRw3yM8HUdM0rmNHC/6G5uKPVThuTaTL/aJUs/umY35rM4L njOfL/R9qTK81+2Na1wzPw8xw6/HLnIDQy3Zmb47BSdy5TMSK5TNgPI7eNK7eRvACIVg Ou9gmwzl6G7vnhqkW1h3VFTSHi2ckkCO8j45qcOGt3WYQehgF4NnMQebBsQ/HsvIwhFT 5WQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si1007460eja.720.2021.01.20.11.09.17; Wed, 20 Jan 2021 11:09:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392545AbhATTFN (ORCPT + 99 others); Wed, 20 Jan 2021 14:05:13 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:45850 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392413AbhATTDX (ORCPT ); Wed, 20 Jan 2021 14:03:23 -0500 Received: from 89-64-80-175.dynamic.chello.pl (89.64.80.175) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.537) id 3b1bfd3e35caa5f7; Wed, 20 Jan 2021 20:02:13 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Erik Kaneda Subject: [PATCH v1 4/6] ACPI: scan: Clean up printing messages Date: Wed, 20 Jan 2021 19:59:51 +0100 Message-ID: <32235625.20C0QTXHV0@kreacher> In-Reply-To: <2809410.8bz27usjlQ@kreacher> References: <2809410.8bz27usjlQ@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki 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 --- 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; }