From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756109AbcE0QNh (ORCPT ); Fri, 27 May 2016 12:13:37 -0400 Received: from smtprelay0010.hostedemail.com ([216.40.44.10]:36165 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755694AbcE0QNe (ORCPT ); Fri, 27 May 2016 12:13:34 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:69:355:379:541:800:960:968:973:982:988:989:1260:1345:1437:1534:1542:1711:1730:1747:1777:1792:1978:1981:2194:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3653:3865:3868:3870:3872:4321:4419:4605:5007:6117:6119:6261:7903:8603:8957:9163:9592:10004:10848:11026:11473:11658:11914:12043:12296:12438:12517:12519:12555:13161:13229:13972:14093:14181:14394:14721:21080:21433:30029:30034:30046:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: mark21_58f939c58283a X-Filterd-Recvd-Size: 3453 From: Joe Perches To: "Rafael J. Wysocki" , Len Brown Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] acpi: pci_slot: Use generic pr_debug utility Date: Fri, 27 May 2016 09:13:29 -0700 Message-Id: <79c094d611a0e844263e01be80dbea3dbbbcfa20.1464365586.git.joe@perches.com> X-Mailer: git-send-email 2.8.0.rc4.16.g56331f8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the dbg macro and debug module parameter and use the generic kernel facility. Trivially reduces defconfig object size on x86-64 $ size drivers/acpi/pci_slot.o* text data bss dec hex filename 880 752 4 1636 664 drivers/acpi/pci_slot.o.new 935 752 5 1692 69c drivers/acpi/pci_slot.o.old Signed-off-by: Joe Perches --- drivers/acpi/pci_slot.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index aa8f4c7..1236fb0 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c @@ -35,7 +35,6 @@ #include #include -static bool debug; static int check_sta_before_sun; #define DRIVER_VERSION "0.1" @@ -44,18 +43,10 @@ static int check_sta_before_sun; MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); -module_param(debug, bool, 0644); #define _COMPONENT ACPI_PCI_COMPONENT ACPI_MODULE_NAME("pci_slot"); -#define dbg(fmt, ...) \ -do { \ - if (debug) \ - pr_debug(fmt, ##__VA_ARGS__); \ -} while (0) - #define SLOT_NAME_SIZE 21 /* Inspired by #define in acpiphp.h */ struct acpi_pci_slot { @@ -75,7 +66,7 @@ check_slot(acpi_handle handle, unsigned long long *sun) struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); - dbg("Checking slot on path: %s\n", (char *)buffer.pointer); + pr_debug("Checking slot on path: %s\n", (char *)buffer.pointer); if (check_sta_before_sun) { /* If SxFy doesn't have _STA, we just assume it's there */ @@ -86,14 +77,16 @@ check_slot(acpi_handle handle, unsigned long long *sun) status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); if (ACPI_FAILURE(status)) { - dbg("_ADR returned %d on %s\n", status, (char *)buffer.pointer); + pr_debug("_ADR returned %d on %s\n", + status, (char *)buffer.pointer); goto out; } /* No _SUN == not a slot == bail */ status = acpi_evaluate_integer(handle, "_SUN", NULL, sun); if (ACPI_FAILURE(status)) { - dbg("_SUN returned %d on %s\n", status, (char *)buffer.pointer); + pr_debug("_SUN returned %d on %s\n", + status, (char *)buffer.pointer); goto out; } @@ -147,8 +140,8 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) get_device(&pci_bus->dev); - dbg("%p, pci_bus: %x, device: %d, name: %s\n", - pci_slot, pci_bus->number, device, name); + pr_debug("%p, pci_bus: %x, device: %d, name: %s\n", + pci_slot, pci_bus->number, device, name); return AE_OK; } -- 2.8.0.rc4.16.g56331f8