Skip to content

Commit ddada07

Browse files
committed
ipc_service: ipc: pbuf: Add assertions for handshake location
Add assertions to test if handshake location is set when it is going to be used. Signed-off-by: Radosław Koppel <[email protected]>
1 parent 670f345 commit ddada07

File tree

1 file changed

+4
-0
lines changed
  • subsys/ipc/ipc_service/lib

1 file changed

+4
-0
lines changed

subsys/ipc/ipc_service/lib/pbuf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ int pbuf_read(struct pbuf *pb, char *buf, uint16_t len)
298298
uint32_t pbuf_handshake_read(struct pbuf *pb)
299299
{
300300
volatile uint32_t *ptr = pb->cfg->handshake_loc;
301+
302+
__ASSERT_NO_MSG(ptr);
301303
sys_cache_data_invd_range((void *)ptr, sizeof(*ptr));
302304
__sync_synchronize();
303305
return *ptr;
@@ -306,6 +308,8 @@ uint32_t pbuf_handshake_read(struct pbuf *pb)
306308
void pbuf_handshake_write(struct pbuf *pb, uint32_t value)
307309
{
308310
volatile uint32_t *ptr = pb->cfg->handshake_loc;
311+
312+
__ASSERT_NO_MSG(ptr);
309313
*ptr = value;
310314
__sync_synchronize();
311315
sys_cache_data_flush_range((void *)ptr, sizeof(*ptr));

0 commit comments

Comments
 (0)