Skip to content

Commit cc73219

Browse files
thugheskartben
authored andcommitted
drivers: flash: spi_nor: Fix unused function warning
Building with clang warns: drivers/flash/spi_nor.c:306:20: error: unused function 'delay_until_exit_dpd_ok' [-Werror,-Wunused-function] static inline void delay_until_exit_dpd_ok(const struct device *const dev) ^ delay_until_exit_dpd_ok is only used when ANY_INST_HAS_DPD is defined. Signed-off-by: Tom Hughes <[email protected]>
1 parent 2a1cef8 commit cc73219

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/flash/spi_nor.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,12 @@ static inline void record_entered_dpd(const struct device *const dev)
305305
#endif
306306
}
307307

308+
#if ANY_INST_HAS_DPD
308309
/* Check the current time against the time DPD was entered and delay
309310
* until it's ok to initiate the DPD exit process.
310311
*/
311312
static inline void delay_until_exit_dpd_ok(const struct device *const dev)
312313
{
313-
#if ANY_INST_HAS_DPD
314314
const struct spi_nor_config *const driver_config = dev->config;
315315

316316
if (driver_config->dpd_exist) {
@@ -338,10 +338,8 @@ static inline void delay_until_exit_dpd_ok(const struct device *const dev)
338338
}
339339
}
340340
}
341-
#else
342-
ARG_UNUSED(dev);
343-
#endif /* ANY_INST_HAS_DPD */
344341
}
342+
#endif /* ANY_INST_HAS_DPD */
345343

346344
/* Indicates that an access command includes bytes for the address.
347345
* If not provided the opcode is not followed by address bytes.

0 commit comments

Comments
 (0)