-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards: remove extern mtd_dev_t *mtd<n>
declarations from board definitions
#20104
boards: remove extern mtd_dev_t *mtd<n>
declarations from board definitions
#20104
Conversation
9df918d
to
c531cdd
Compare
extern mld_dev_t *mtd<n>
declarations from board definitionsextern mtd_dev_t *mtd<n>
declarations from board definitions
2a01590
to
1236536
Compare
Just wondering: |
No, I just forgot them, |
Please squash! |
drivers/include/mtd.h
Outdated
#ifdef MTD_0 | ||
extern mtd_dev_t *MTD_0; | ||
#endif | ||
#ifdef MTD_1 | ||
extern mtd_dev_t *MTD_1; | ||
#endif | ||
#ifdef MTD_2 | ||
extern mtd_dev_t *MTD_2; | ||
#endif | ||
#ifdef MTD_3 | ||
extern mtd_dev_t *MTD_3; | ||
#endif | ||
#ifdef MTD_4 | ||
extern mtd_dev_t *MTD_4; | ||
#endif | ||
#ifdef MTD_5 | ||
extern mtd_dev_t *MTD_5; | ||
#endif | ||
#endif /* !DOXYGEN */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this?
Hm why not rip off the band aid completely and replace I might also just submit a PR for that. |
How would you handle this case? RIOT/tests/pkg/littlefs/main.c Line 29 in 848f3d1
|
Do you think that all #define MTD_0 mtd_dev_get(0) instead of #define MTD0 mtd0 |
Assertions are used instead of returning a NULL pointer to detect errors in the MTD definition and access in the case that the return value is not evaluated.
Since the `extern mtd_dev_t *` declarations were removed from board definitions, `mtd_dev_get` has to be used instead.
Since the `extern mtd_dev_t *` declarations were removed from board definitions, `mtd_dev_get` has to be used instead.
Since the `extern mtd_dev_t *` declarations were removed from board definitions, `mtd_dev_get` has to be used instead.
4a21c4c
to
c93f0a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
Thanks |
Contribution description
The PR removes the
extern mld_dev_t *mtd<n>
declarations from board definitions.For that purpose, the
extern mtd_dev_t *mtd<n>
declarations that use theMTD_<n>
definitions of the board are moved frommtd_default.h
tomtd.h
to declare them even if themtd_default
module is not used.Testing procedure
Green CI.
Issues/PRs references
Prerequisite for PR #19786
Prerequisite for PR #19540