diff options
| author | Joe Perches <joe@perches.com> | 2016-05-27 12:13:29 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-06-21 20:03:27 -0400 |
| commit | 409ffed2b6ae1d5db3cefed2e0fb2ca7e3f352bd (patch) | |
| tree | a015037ba3b0298e20a8d418c4fa72ea3e89cb9e | |
| parent | 2cfd93dd21b0127feae2579d46b7650fbacd2af1 (diff) | |
ACPI / PCI: pci_slot: Use generic pr_debug utility
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 <joe@perches.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| -rw-r--r-- | drivers/acpi/pci_slot.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index aa8f4c72b687..1236fb04a708 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | #include <linux/dmi.h> | 35 | #include <linux/dmi.h> |
| 36 | #include <linux/pci-acpi.h> | 36 | #include <linux/pci-acpi.h> |
| 37 | 37 | ||
| 38 | static bool debug; | ||
| 39 | static int check_sta_before_sun; | 38 | static int check_sta_before_sun; |
| 40 | 39 | ||
| 41 | #define DRIVER_VERSION "0.1" | 40 | #define DRIVER_VERSION "0.1" |
| @@ -44,18 +43,10 @@ static int check_sta_before_sun; | |||
| 44 | MODULE_AUTHOR(DRIVER_AUTHOR); | 43 | MODULE_AUTHOR(DRIVER_AUTHOR); |
| 45 | MODULE_DESCRIPTION(DRIVER_DESC); | 44 | MODULE_DESCRIPTION(DRIVER_DESC); |
| 46 | MODULE_LICENSE("GPL"); | 45 | MODULE_LICENSE("GPL"); |
| 47 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); | ||
| 48 | module_param(debug, bool, 0644); | ||
| 49 | 46 | ||
| 50 | #define _COMPONENT ACPI_PCI_COMPONENT | 47 | #define _COMPONENT ACPI_PCI_COMPONENT |
| 51 | ACPI_MODULE_NAME("pci_slot"); | 48 | ACPI_MODULE_NAME("pci_slot"); |
| 52 | 49 | ||
| 53 | #define dbg(fmt, ...) \ | ||
| 54 | do { \ | ||
| 55 | if (debug) \ | ||
| 56 | pr_debug(fmt, ##__VA_ARGS__); \ | ||
| 57 | } while (0) | ||
| 58 | |||
| 59 | #define SLOT_NAME_SIZE 21 /* Inspired by #define in acpiphp.h */ | 50 | #define SLOT_NAME_SIZE 21 /* Inspired by #define in acpiphp.h */ |
| 60 | 51 | ||
| 61 | struct acpi_pci_slot { | 52 | struct acpi_pci_slot { |
| @@ -75,7 +66,7 @@ check_slot(acpi_handle handle, unsigned long long *sun) | |||
| 75 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 66 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
| 76 | 67 | ||
| 77 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); | 68 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); |
| 78 | dbg("Checking slot on path: %s\n", (char *)buffer.pointer); | 69 | pr_debug("Checking slot on path: %s\n", (char *)buffer.pointer); |
| 79 | 70 | ||
| 80 | if (check_sta_before_sun) { | 71 | if (check_sta_before_sun) { |
| 81 | /* If SxFy doesn't have _STA, we just assume it's there */ | 72 | /* 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) | |||
| 86 | 77 | ||
| 87 | status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); | 78 | status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); |
| 88 | if (ACPI_FAILURE(status)) { | 79 | if (ACPI_FAILURE(status)) { |
| 89 | dbg("_ADR returned %d on %s\n", status, (char *)buffer.pointer); | 80 | pr_debug("_ADR returned %d on %s\n", |
| 81 | status, (char *)buffer.pointer); | ||
| 90 | goto out; | 82 | goto out; |
| 91 | } | 83 | } |
| 92 | 84 | ||
| 93 | /* No _SUN == not a slot == bail */ | 85 | /* No _SUN == not a slot == bail */ |
| 94 | status = acpi_evaluate_integer(handle, "_SUN", NULL, sun); | 86 | status = acpi_evaluate_integer(handle, "_SUN", NULL, sun); |
| 95 | if (ACPI_FAILURE(status)) { | 87 | if (ACPI_FAILURE(status)) { |
| 96 | dbg("_SUN returned %d on %s\n", status, (char *)buffer.pointer); | 88 | pr_debug("_SUN returned %d on %s\n", |
| 89 | status, (char *)buffer.pointer); | ||
| 97 | goto out; | 90 | goto out; |
| 98 | } | 91 | } |
| 99 | 92 | ||
| @@ -147,8 +140,8 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
| 147 | 140 | ||
| 148 | get_device(&pci_bus->dev); | 141 | get_device(&pci_bus->dev); |
| 149 | 142 | ||
| 150 | dbg("%p, pci_bus: %x, device: %d, name: %s\n", | 143 | pr_debug("%p, pci_bus: %x, device: %d, name: %s\n", |
| 151 | pci_slot, pci_bus->number, device, name); | 144 | pci_slot, pci_bus->number, device, name); |
| 152 | 145 | ||
| 153 | return AE_OK; | 146 | return AE_OK; |
| 154 | } | 147 | } |
