Skip to content

Commit 40113d9

Browse files
piotrkoziaranangl
authored andcommitted
[nrf fromtree] modules: hal_nordic: suppress 'unused variable' warnings
Refactors the code to avoid 'unused variable' warning that is problematic for some builds. Signed-off-by: Piotr Koziar <[email protected]> (cherry picked from commit 8f83ffc)
1 parent f22cb03 commit 40113d9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,28 @@ static void hfclk_on_callback(struct onoff_manager *mgr,
4545
#if defined(CONFIG_CLOCK_CONTROL_NRF)
4646
void nrf_802154_clock_hfclk_start(void)
4747
{
48-
int ret;
4948
struct onoff_manager *mgr =
5049
z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF);
5150

5251
__ASSERT_NO_MSG(mgr != NULL);
5352

5453
sys_notify_init_callback(&hfclk_cli.notify, hfclk_on_callback);
5554

56-
ret = onoff_request(mgr, &hfclk_cli);
55+
int ret = onoff_request(mgr, &hfclk_cli);
5756
__ASSERT_NO_MSG(ret >= 0);
57+
(void)ret;
5858
}
5959

6060
void nrf_802154_clock_hfclk_stop(void)
6161
{
62-
int ret;
6362
struct onoff_manager *mgr =
6463
z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF);
6564

6665
__ASSERT_NO_MSG(mgr != NULL);
6766

68-
ret = onoff_cancel_or_release(mgr, &hfclk_cli);
67+
int ret = onoff_cancel_or_release(mgr, &hfclk_cli);
6968
__ASSERT_NO_MSG(ret >= 0);
69+
(void)ret;
7070
hfclk_is_running = false;
7171
}
7272

@@ -78,6 +78,7 @@ void nrf_802154_clock_hfclk_start(void)
7878
int ret = nrf_clock_control_request(DEVICE_DT_GET(DT_NODELABEL(hfxo)), NULL, &hfclk_cli);
7979

8080
__ASSERT_NO_MSG(ret >= 0);
81+
(void)ret;
8182
}
8283

8384
void nrf_802154_clock_hfclk_stop(void)
@@ -86,6 +87,7 @@ void nrf_802154_clock_hfclk_stop(void)
8687
NULL, &hfclk_cli);
8788

8889
__ASSERT_NO_MSG(ret >= 0);
90+
(void)ret;
8991
}
9092

9193
#endif

0 commit comments

Comments
 (0)