diff options
author | Gabe Black <gabeblack@google.com> | 2012-11-01 15:44:10 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2012-11-07 18:38:37 +0100 |
commit | 93ded5905c36d34c4e4f132623c854bbd895b8c9 (patch) | |
tree | 242d35c611db91e2351a4e942ff518a66110ca38 /payloads/libpayload/drivers/usb/usbhid.c | |
parent | 8670b9b81aba6bf51510e337d4f7208d2b4ea320 (diff) |
libpayload: Turn the "debug" #define into the usb_debug static inline function.
The "debug" macro used internally in the libpayload USB subsystem was very
generically named and would leak into consumers of the library that included
usb.h directly or indirectly. This change turns that #define from a macro into
a static inline function to move away from the preprocessor, and also renames
it to usb_debug so it's less likely to collide with something unrelated.
Change-Id: I18717df111aa9671495f8a2a5bdb2c6311fa7acf
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://review.coreboot.org/1738
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'payloads/libpayload/drivers/usb/usbhid.c')
-rw-r--r-- | payloads/libpayload/drivers/usb/usbhid.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/payloads/libpayload/drivers/usb/usbhid.c b/payloads/libpayload/drivers/usb/usbhid.c index d5141c6353..496fbaa3f7 100644 --- a/payloads/libpayload/drivers/usb/usbhid.c +++ b/payloads/libpayload/drivers/usb/usbhid.c @@ -324,7 +324,7 @@ usb_hid_process_keyboard_event(usb_hid_keyboard_event_t *current, if (keypress == -1) { /* Debug: Print unknown keys */ - debug ("usbhid: <%x> %x [ %x %x %x %x %x %x ] %d\n", + usb_debug ("usbhid: <%x> %x [ %x %x %x %x %x %x ] %d\n", current->modifiers, current->repeats, current->keys[0], current->keys[1], current->keys[2], current->keys[3], @@ -429,18 +429,18 @@ usb_hid_init (usbdev_t *dev) if (interface->bInterfaceSubClass == hid_subclass_boot) { u8 countrycode; - debug (" supports boot interface..\n"); - debug (" it's a %s\n", + usb_debug (" supports boot interface..\n"); + usb_debug (" it's a %s\n", boot_protos[interface->bInterfaceProtocol]); switch (interface->bInterfaceProtocol) { case hid_boot_proto_keyboard: dev->data = malloc (sizeof (usbhid_inst_t)); if (!dev->data) fatal("Not enough memory for USB HID device.\n"); - debug (" configuring...\n"); + usb_debug (" configuring...\n"); usb_hid_set_protocol(dev, interface, hid_proto_boot); usb_hid_set_idle(dev, interface, KEYBOARD_REPEAT_MS); - debug (" activating...\n"); + usb_debug (" activating...\n"); HID_INST (dev)->descriptor = (hid_descriptor_t *) @@ -451,7 +451,7 @@ usb_hid_init (usbdev_t *dev) /* 35 countries defined: */ if (countrycode > 35) countrycode = 0; - debug (" Keyboard has %s layout (country code %02x)\n", + usb_debug (" Keyboard has %s layout (country code %02x)\n", countries[countrycode][0], countrycode); /* Set keyboard layout accordingly */ @@ -470,14 +470,14 @@ usb_hid_init (usbdev_t *dev) continue; break; } - debug (" found endpoint %x for interrupt-in\n", i); + usb_debug (" found endpoint %x for interrupt-in\n", i); /* 20 buffers of 8 bytes, for every 10 msecs */ HID_INST(dev)->queue = dev->controller->create_intr_queue (&dev->endpoints[i], 8, 20, 10); keycount = 0; - debug (" configuration done.\n"); + usb_debug (" configuration done.\n"); break; case hid_boot_proto_mouse: - debug("NOTICE: USB mice are not supported.\n"); + usb_debug("NOTICE: USB mice are not supported.\n"); break; } } |