Skip to content

Commit 29ca1f6

Browse files
committed
Make all function that "inline" function as "static inline"
1 parent eac28ca commit 29ca1f6

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

lib/usbd/backend/usbd_stm32_fsdev.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
#include <unicore-mx/stm32/st_usbfs.h>
2727
#include <unicore-mx/usbd/usbd.h>
2828

29-
inline void ep_set_stat(uint8_t num, bool rx, uint16_t stat);
30-
inline void ep_clear_ctr(uint8_t num, bool rx);
31-
inline void ep_set_type(uint8_t num, uint16_t eptype);
29+
static inline void ep_set_stat(uint8_t num, bool rx, uint16_t stat);
30+
static inline void ep_clear_ctr(uint8_t num, bool rx);
31+
static inline void ep_set_type(uint8_t num, uint16_t eptype);
3232

3333
/**
3434
* Set the endpoint @a num status to @a status
3535
* @param num Endpoint number (not including direction)
3636
* @param rx true for RX, false for TX
3737
* @param stat Status
3838
*/
39-
inline void ep_set_stat(uint8_t num, bool rx, uint16_t stat)
39+
static inline void ep_set_stat(uint8_t num, bool rx, uint16_t stat)
4040
{
4141
uint16_t ep = USB_EP(num);
4242
ep &= USB_EP_TYPE_MASK | USB_EP_KIND | USB_EP_EA_MASK |
@@ -51,7 +51,7 @@ inline void ep_set_stat(uint8_t num, bool rx, uint16_t stat)
5151
* @param num Endpoint number (not including direction)
5252
* @param rx true for CTR_RX, false for CTR_TX
5353
*/
54-
inline void ep_clear_ctr(uint8_t num, bool rx)
54+
static inline void ep_clear_ctr(uint8_t num, bool rx)
5555
{
5656
uint16_t ep = USB_EP(num);
5757
ep &= USB_EP_TYPE_MASK | USB_EP_KIND | USB_EP_EA_MASK;
@@ -64,7 +64,7 @@ inline void ep_clear_ctr(uint8_t num, bool rx)
6464
* @param num Endpoint number (not including direction)
6565
* @param eptype New endpoint type
6666
*/
67-
inline void ep_set_type(uint8_t num, uint16_t eptype)
67+
static inline void ep_set_type(uint8_t num, uint16_t eptype)
6868
{
6969
uint16_t ep = USB_EP(num);
7070
ep &= USB_EP_KIND | USB_EP_EA_MASK;

lib/usbd/usbd_private.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -294,22 +294,22 @@ void usbd_put_all_urb_into_unused(usbd_device *dev);
294294
void usbd_purge_all_non_ep0_transfer(usbd_device *dev,
295295
usbd_transfer_status status);
296296

297-
inline uint32_t ep_free_mask(uint8_t ep_addr);
298-
inline void usbd_handle_suspend(usbd_device *dev);
299-
inline void usbd_handle_resume(usbd_device *dev);
300-
inline void usbd_handle_sof(usbd_device *dev);
301-
inline void usbd_handle_setup(usbd_device *dev, uint8_t ep,
297+
static inline uint32_t ep_free_mask(uint8_t ep_addr);
298+
static inline void usbd_handle_suspend(usbd_device *dev);
299+
static inline void usbd_handle_resume(usbd_device *dev);
300+
static inline void usbd_handle_sof(usbd_device *dev);
301+
static inline void usbd_handle_setup(usbd_device *dev, uint8_t ep,
302302
const struct usb_setup_data *setup_data);
303-
inline void usbd_handle_reset(usbd_device *dev);
304-
inline bool is_ep_free(usbd_device *dev, uint8_t ep_addr);
305-
inline void mark_ep_as_free(usbd_device *dev, uint8_t ep_addr, bool yes);
303+
static inline void usbd_handle_reset(usbd_device *dev);
304+
static inline bool is_ep_free(usbd_device *dev, uint8_t ep_addr);
305+
static inline void mark_ep_as_free(usbd_device *dev, uint8_t ep_addr, bool yes);
306306

307307
/**
308308
* Get the DTOG bit mask for @a ep_addr
309309
* @param[in] ep_addr Endpoint address (including direction)
310310
* @return mask
311311
*/
312-
inline uint32_t ep_free_mask(uint8_t ep_addr)
312+
static inline uint32_t ep_free_mask(uint8_t ep_addr)
313313
{
314314
uint32_t num = ENDPOINT_NUMBER(ep_addr);
315315

@@ -324,7 +324,7 @@ inline uint32_t ep_free_mask(uint8_t ep_addr)
324324
* SUSPEND detected on bus
325325
* @param[in] dev USB Device
326326
*/
327-
inline void usbd_handle_suspend(usbd_device *dev)
327+
static inline void usbd_handle_suspend(usbd_device *dev)
328328
{
329329
LOG_LN("SUSPEND detected!");
330330

@@ -337,7 +337,7 @@ inline void usbd_handle_suspend(usbd_device *dev)
337337
* RESUME detected on bus
338338
* @param[in] dev USB Device
339339
*/
340-
inline void usbd_handle_resume(usbd_device *dev)
340+
static inline void usbd_handle_resume(usbd_device *dev)
341341
{
342342
LOG_LN("RESUME detected!");
343343

@@ -350,7 +350,7 @@ inline void usbd_handle_resume(usbd_device *dev)
350350
* SOF detected on bus
351351
* @param[in] dev USB Device
352352
*/
353-
inline void usbd_handle_sof(usbd_device *dev)
353+
static inline void usbd_handle_sof(usbd_device *dev)
354354
{
355355
/* Oh no! dont print anything here... or else... */
356356

@@ -367,7 +367,7 @@ inline void usbd_handle_sof(usbd_device *dev)
367367
* @param[in] setup_data Setup Data
368368
* @note setup_data is only expected to be valid till this function do not return.
369369
*/
370-
inline void usbd_handle_setup(usbd_device *dev, uint8_t ep,
370+
static inline void usbd_handle_setup(usbd_device *dev, uint8_t ep,
371371
const struct usb_setup_data *setup_data)
372372
{
373373
if (dev->callback.setup != NULL) {
@@ -388,7 +388,7 @@ inline void usbd_handle_setup(usbd_device *dev, uint8_t ep,
388388
* RESET detected on bus
389389
* @param[in] dev USB Device
390390
*/
391-
inline void usbd_handle_reset(usbd_device *dev)
391+
static inline void usbd_handle_reset(usbd_device *dev)
392392
{
393393
LOG_LN("RESET detected");
394394

@@ -408,7 +408,7 @@ inline void usbd_handle_reset(usbd_device *dev)
408408
* @param[in] dev USB Device
409409
* @param[in] ep_addr Endpoint (including direction)
410410
*/
411-
inline bool is_ep_free(usbd_device *dev, uint8_t ep_addr)
411+
static inline bool is_ep_free(usbd_device *dev, uint8_t ep_addr)
412412
{
413413
return !!(dev->urbs.ep_free & ep_free_mask(ep_addr));
414414
}
@@ -419,7 +419,7 @@ inline bool is_ep_free(usbd_device *dev, uint8_t ep_addr)
419419
* @param[in] ep_addr Endpoint address (including direction)
420420
* @param[in] yes Yes (if true, mark it as unused)
421421
*/
422-
inline void mark_ep_as_free(usbd_device *dev, uint8_t ep_addr, bool yes)
422+
static inline void mark_ep_as_free(usbd_device *dev, uint8_t ep_addr, bool yes)
423423
{
424424
uint32_t mask = ep_free_mask(ep_addr);
425425
if (yes) {

0 commit comments

Comments
 (0)