Skip to contentSkip to conversation

- bay.c - convert macro to function

PATCH New Joe Perches 1 participant 1 message Nov 1, 2007 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 - bay.c - convert macro to function

Convert bay_dprintk from macro to function.

Compiled/untested x86
Reduces image size ~250 bytes.

old:

$ size drivers/acpi/bay.o
   text    data     bss     dec     hex filename
   2088      48       0    2136     858 drivers/acpi/bay.o

new:

$ size drivers/acpi/bay.o
   text    data     bss     dec     hex filename
   1716      48       0    1764     6e4 drivers/acpi/bay.o

---

drivers/acpi/bay.c +9 -5
index 6daf608..93c735b 100644
@@ -39,11 +39,7 @@ MODULE_LICENSE("GPL");
 #define ACPI_BAY_CLASS "bay"
 #define ACPI_BAY_COMPONENT	0x10000000
 #define _COMPONENT ACPI_BAY_COMPONENT
-#define bay_dprintk(h,s) {\
-	char prefix[80] = {'\0'};\
-	struct acpi_buffer buffer = {sizeof(prefix), prefix};\
-	acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\
-	printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); }
+
 static void bay_notify(acpi_handle handle, u32 event, void *data);
 
 struct bay {
@@ -55,6 +51,14 @@ struct bay {
 
 static LIST_HEAD(drive_bays);
 
+static void bay_dprintk(acpi_handle handle, const char *string)
+{
+	char prefix[80] = {'\0'};
+	struct acpi_buffer buffer = {sizeof(prefix), prefix};
+
+	acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
+	printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, string);
+}
 
 /*****************************************************************************
  *                         Drive Bay functions                               *