This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 7a8a890b055 include/nuttx/sdio.h: guard callbackenable under HPWORK
support
7a8a890b055 is described below
commit 7a8a890b05538228c5bc4ad90ba4c0f2b67a0a91
Author: Sarthak Pandey <[email protected]>
AuthorDate: Wed Oct 14 00:04:39 2026 +0530
include/nuttx/sdio.h: guard callbackenable under HPWORK support
The callbackenable function prototype and macro were previously outside
the ifdef guards for HPWORK queue support, while registercallback was
guarded by CONFIG_SCHED_WORKQUEUE && CONFIG_SCHED_HPWORK.
Since callbacks require high-priority work queue support to be
registered and executed, enabling callbacks without HPWORK support
enables nothing and leaves an unnecessary function pointer in
struct sdio_dev_s.
This commit:
- Guards callbackenable in struct sdio_dev_s under
CONFIG_SCHED_WORKQUEUE && CONFIG_SCHED_HPWORK.
- Defines SDIO_CALLBACKENABLE as a no-op ((void)0) when HPWORK is
disabled to prevent compilation breaks in upper-half drivers.
Fixes: #17249
Signed-off-by: Sarthak Pandey <[email protected]>
---
include/nuttx/sdio.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/nuttx/sdio.h b/include/nuttx/sdio.h
index 8ce6bf3cc2b..fe6f6e661bd 100644
--- a/include/nuttx/sdio.h
+++ b/include/nuttx/sdio.h
@@ -834,7 +834,11 @@
*
****************************************************************************/
-#define SDIO_CALLBACKENABLE(dev,eventset) ((dev)->callbackenable(dev,eventset))
+#if defined(CONFIG_SCHED_WORKQUEUE) && defined(CONFIG_SCHED_HPWORK)
+# define SDIO_CALLBACKENABLE(dev,eventset)
((dev)->callbackenable(dev,eventset))
+#else
+# define SDIO_CALLBACKENABLE(dev,eventset) ((void)0)
+#endif
/****************************************************************************
* Name: SDIO_REGISTERCALLBACK
@@ -1063,10 +1067,10 @@ struct sdio_dev_s
CODE void (*waitenable)(FAR struct sdio_dev_s *dev,
sdio_eventset_t eventset, uint32_t timeout);
CODE sdio_eventset_t (*eventwait)(FAR struct sdio_dev_s *dev);
- CODE void (*callbackenable)(FAR struct sdio_dev_s *dev,
- sdio_eventset_t eventset);
#if defined(CONFIG_SCHED_WORKQUEUE) && defined(CONFIG_SCHED_HPWORK)
+ CODE void (*callbackenable)(FAR struct sdio_dev_s *dev,
+ sdio_eventset_t eventset);
CODE int (*registercallback)(FAR struct sdio_dev_s *dev,
worker_t callback, FAR void *arg);
#endif