diff options
author | Jett Rink <jettrink@chromium.org> | 2020-08-12 14:35:40 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-13 22:32:24 +0000 |
commit | b0a3a4fc5df23043823a82b727c7cd4dd14b35d7 (patch) | |
tree | 8251e7a41838a87bd1222d25cfe4414146a7e158 /include/usb_sm.h | |
parent | 0df97d0e5846493c868eabe4c1647d67a946d7fd (diff) | |
download | chrome-ec-b0a3a4fc5df23043823a82b727c7cd4dd14b35d7.tar.gz |
usbc: add GEN_NOT_SUPPORTED macro for unsupported states
To enabled use of the IS_ENABLE macro we need to define some of the usb
state machine states as extern variables that will never be linked. This
allows the compiler to know about a state but will still fail the
linking phase if the config option is not defined properly.
This is just adding a convenience macro for this paradigm, not creating
the paradigm itself.
BRANCH=none
BUG=none
TEST=builds
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: Ia19b5babd43d536f043745314481475cf25f6e01
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2353369
Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'include/usb_sm.h')
-rw-r--r-- | include/usb_sm.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/usb_sm.h b/include/usb_sm.h index 5d89b4e890..d8eff5190a 100644 --- a/include/usb_sm.h +++ b/include/usb_sm.h @@ -105,4 +105,7 @@ struct test_sm_data { }; #endif +/* Creates a state machine state that will never link. Useful with IS_ENABLED */ +#define GEN_NOT_SUPPORTED(state) extern typeof(state) state ## _NOT_SUPPORTED + #endif /* __CROS_EC_USB_SM_H */ |