summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/sbc_harness/config/tusb_config.h4
-rw-r--r--libcr_ipc/include/libcr_ipc/chan.h2
-rw-r--r--libcr_ipc/include/libcr_ipc/rpc.h2
-rw-r--r--libhw_cr/rp2040_include/libhw/rp2040_hwspi.h2
-rw-r--r--libmisc/include/libmisc/assert.h6
-rw-r--r--libmisc/include/libmisc/linkedlist.h10
-rw-r--r--libmisc/include/libmisc/map.h2
7 files changed, 16 insertions, 12 deletions
diff --git a/cmd/sbc_harness/config/tusb_config.h b/cmd/sbc_harness/config/tusb_config.h
index 0a6d3e4..5240311 100644
--- a/cmd/sbc_harness/config/tusb_config.h
+++ b/cmd/sbc_harness/config/tusb_config.h
@@ -1,6 +1,6 @@
/* tusb_config.h - Compile-time configuration for the TinyUSB library
*
- * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+ * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* SPDX-License-Identifier: MIT
@@ -61,7 +61,7 @@ extern "C" {
TU_BREAKPOINT(); \
return _ret; \
} \
- } while(0)
+ } while (0)
void _libmisc_tu_mess_failed(const char *expr,
const char *file, unsigned int line, const char *func);
diff --git a/libcr_ipc/include/libcr_ipc/chan.h b/libcr_ipc/include/libcr_ipc/chan.h
index 853b4ad..c57979a 100644
--- a/libcr_ipc/include/libcr_ipc/chan.h
+++ b/libcr_ipc/include/libcr_ipc/chan.h
@@ -48,7 +48,7 @@
#define cr_chan_send(CH, VAL) do { \
typeof((CH)->val_typ[0]) _val_lvalue = VAL; \
(void)cr_select_l(CR_SELECT_SEND(CH, &_val_lvalue)); \
-} while(0)
+} while (0)
/**
* cr_chan_recv(ch) reads and returns a value from ch.
diff --git a/libcr_ipc/include/libcr_ipc/rpc.h b/libcr_ipc/include/libcr_ipc/rpc.h
index ecf48cf..bfa0a04 100644
--- a/libcr_ipc/include/libcr_ipc/rpc.h
+++ b/libcr_ipc/include/libcr_ipc/rpc.h
@@ -123,7 +123,7 @@
*((REQ)._resp) = RESP; \
cr_unpause(REQ._requester); \
cr_yield(); \
-} while(0)
+} while (0)
/* Background details *********************************************************/
diff --git a/libhw_cr/rp2040_include/libhw/rp2040_hwspi.h b/libhw_cr/rp2040_include/libhw/rp2040_hwspi.h
index 4951136..8d4effa 100644
--- a/libhw_cr/rp2040_include/libhw/rp2040_hwspi.h
+++ b/libhw_cr/rp2040_include/libhw/rp2040_hwspi.h
@@ -99,7 +99,7 @@ LO_IMPLEMENTATION_H(spi, struct rp2040_hwspi, rp2040_hwspi);
min_delay_ns, bogus_data, \
pin_miso, pin_mosi, pin_clk, pin_cs, \
dma1, dma2, dma3, dma4); \
- } while(0)
+ } while (0)
void _rp2040_hwspi_init(struct rp2040_hwspi *self,
enum rp2040_hwspi_instance inst_num,
enum spi_mode mode,
diff --git a/libmisc/include/libmisc/assert.h b/libmisc/include/libmisc/assert.h
index 0563a58..ccdb288 100644
--- a/libmisc/include/libmisc/assert.h
+++ b/libmisc/include/libmisc/assert.h
@@ -10,7 +10,11 @@
#ifdef NDEBUG
# define __assert_msg(expr, expr_str, msg) ((void)0)
#else
-# define __assert_msg(expr, expr_str, msg) do { if (!(expr)) __assert_msg_fail(expr_str, __FILE__, __LINE__, __func__, msg); } while (0)
+# define __assert_msg(expr, expr_str, msg) \
+ do { \
+ if (!(expr)) \
+ __assert_msg_fail(expr_str, __FILE__, __LINE__, __func__, msg); \
+ } while (0)
[[noreturn]] void __assert_msg_fail(const char *expr,
const char *file, unsigned int line, const char *func,
const char *msg);
diff --git a/libmisc/include/libmisc/linkedlist.h b/libmisc/include/libmisc/linkedlist.h
index e8c65db..b6ff688 100644
--- a/libmisc/include/libmisc/linkedlist.h
+++ b/libmisc/include/libmisc/linkedlist.h
@@ -56,14 +56,14 @@ void _dlist_pop_from_front(struct _dlist_root *root);
typeof(*_rootp->front) *_nodep = NODE; \
_slist_push_to_rear((struct _slist_root *)_rootp, \
(struct _slist_node *)_nodep); \
-} while(0)
+} while (0)
#define slist_pop_from_front(ROOT) { \
/* This temporary variables are to get the compiler to check \
* the type. */ \
typeof(*(ROOT)->_slist_root_typ[0]) *_rootp = ROOT; \
_slist_pop_from_front((struct _slist_root *)_rootp); \
-} while(0)
+} while (0)
/* doubly linked list (non-intrusive) *****************************************/
@@ -87,7 +87,7 @@ void _dlist_pop_from_front(struct _dlist_root *root);
typeof(*_rootp->front) *_nodep = NODE; \
_dlist_push_to_rear((struct _dlist_root *)_rootp, \
(struct _dlist_node *)_nodep); \
-} while(0)
+} while (0)
#define dlist_remove(ROOT, NODE) { \
/* These temporary variables are to get the compiler to check \
@@ -96,13 +96,13 @@ void _dlist_pop_from_front(struct _dlist_root *root);
typeof(*_rootp->front) *_nodep = NODE; \
_dlist_remove((struct _dlist_root *)_rootp, \
(struct _dlist_node *)_nodep); \
-} while(0)
+} while (0)
#define dlist_pop_from_front(ROOT) { \
/* This temporary variables are to get the compiler to check \
* the type. */ \
typeof(*(ROOT)->_dlist_root_typ[0]) *_rootp = ROOT; \
_dlist_pop_from_front((struct _dlist_root *)_rootp); \
-} while(0)
+} while (0)
#endif /* _LIBMISC_LINKEDLIST_H_ */
diff --git a/libmisc/include/libmisc/map.h b/libmisc/include/libmisc/map.h
index 41ac069..6622595 100644
--- a/libmisc/include/libmisc/map.h
+++ b/libmisc/include/libmisc/map.h
@@ -52,7 +52,7 @@ struct _map {
(M)->core.offsetof_k = offsetof(typeof((M)->kv_typ[0]), val.key); \
(M)->core.offsetof_v = offsetof(typeof((M)->kv_typ[0]), val.val); \
} \
-} while(0)
+} while (0)
/* Methods ********************************************************************/