summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2014-12-02 10:15:48 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-12-08 21:51:48 +0000
commit0f4550468fac985711ef10629ad9d5129c9e4539 (patch)
tree056d42d511004db69ee3c94426b84a5e5d8043ae
parent0967049df61384a4f25cdfe46ff1d4a38b1c787a (diff)
downloadchrome-ec-0f4550468fac985711ef10629ad9d5129c9e4539.tar.gz
USB-SPI: Make global initializer names more unique
Previously it was relatively easy to collide with these names in user code, adding the _ suffix makes that much less likely. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: I997e1bc81aab4ca0b16e011bf5ff66444320c4f1 Reviewed-on: https://chromium-review.googlesource.com/232731 Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
-rw-r--r--chip/stm32/usb_spi.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/chip/stm32/usb_spi.h b/chip/stm32/usb_spi.h
index a90898578d..1880540043 100644
--- a/chip/stm32/usb_spi.h
+++ b/chip/stm32/usb_spi.h
@@ -103,14 +103,14 @@ struct usb_spi_config {
INTERFACE, \
ENDPOINT, \
READY) \
- static uint16_t CONCAT2(NAME, _buffer)[USB_MAX_PACKET_SIZE / 2]; \
- static usb_uint CONCAT2(NAME, _ep_rx_buffer)[USB_MAX_PACKET_SIZE / 2] __usb_ram; \
- static usb_uint CONCAT2(NAME, _ep_tx_buffer)[USB_MAX_PACKET_SIZE / 2] __usb_ram; \
+ static uint16_t CONCAT2(NAME, _buffer_)[USB_MAX_PACKET_SIZE / 2]; \
+ static usb_uint CONCAT2(NAME, _ep_rx_buffer_)[USB_MAX_PACKET_SIZE / 2] __usb_ram; \
+ static usb_uint CONCAT2(NAME, _ep_tx_buffer_)[USB_MAX_PACKET_SIZE / 2] __usb_ram; \
struct usb_spi_config const NAME = { \
.endpoint = ENDPOINT, \
- .buffer = CONCAT2(NAME, _buffer), \
- .rx_ram = CONCAT2(NAME, _ep_rx_buffer), \
- .tx_ram = CONCAT2(NAME, _ep_tx_buffer), \
+ .buffer = CONCAT2(NAME, _buffer_), \
+ .rx_ram = CONCAT2(NAME, _ep_rx_buffer_), \
+ .tx_ram = CONCAT2(NAME, _ep_tx_buffer_), \
.ready = READY, \
}; \
const struct usb_interface_descriptor \
@@ -143,13 +143,13 @@ struct usb_spi_config {
.wMaxPacketSize = USB_MAX_PACKET_SIZE, \
.bInterval = 0, \
}; \
- static void CONCAT2(NAME, _ep_tx) (void) { usb_spi_tx (&NAME); } \
- static void CONCAT2(NAME, _ep_rx) (void) { usb_spi_rx (&NAME); } \
- static void CONCAT2(NAME, _ep_reset)(void) { usb_spi_reset(&NAME); } \
+ static void CONCAT2(NAME, _ep_tx_) (void) { usb_spi_tx (&NAME); } \
+ static void CONCAT2(NAME, _ep_rx_) (void) { usb_spi_rx (&NAME); } \
+ static void CONCAT2(NAME, _ep_reset_)(void) { usb_spi_reset(&NAME); } \
USB_DECLARE_EP(ENDPOINT, \
- CONCAT2(NAME, _ep_tx), \
- CONCAT2(NAME, _ep_rx), \
- CONCAT2(NAME, _ep_reset));
+ CONCAT2(NAME, _ep_tx_), \
+ CONCAT2(NAME, _ep_rx_), \
+ CONCAT2(NAME, _ep_reset_));
/*
* Check for a new request and process it synchronously, the SPI transaction