Skip to content
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

drivers/mtd: fix the order of entries in the MTD pointer XFA mtd_dev_xfa #20113

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Nov 27, 2023

Contribution description

The commit fixes the order of entries in the MTD pointer XFA mtd_dev_xfa according to their index by using the index as the priority in the XFA.

Since PR #19465, the pointers to existing MTD devices mtd0, mtd1, ... mtd<n> are hold in the MTD pointer XFA mtd_dev_xfa. The order of these pointers in the XFA should correspond to their index so that mtd_dev_xfa[i] gives mtd<i> which points to the i-th MTD. For that purpose the idx parameter of the MTD_XFA_ADD macro has to be used as priority.

Testing procedure

Compile

BOARD=same54-xpro make -j8 -C tests/sys/vfs_default/

with and without this PR. Without this PR, command

nm -s tests/sys/vfs_default/bin/same54-xpro/tests_vfs_default.elf | sort | grep "mtd[0-9]"

will give

0001039c T mtd1
000103a0 T mtd0
000103a4 T mtd2

With this PR, the command should give:

000103c4 T mtd0
000103c8 T mtd1
000103cc T mtd2

Issues/PRs references

The commit fixes the order of entries in the MTD pointer XFA `mtd_dev_xfa` according to their index by using the index as the priority in the XFA.
@github-actions github-actions bot added the Area: drivers Area: Device drivers label Nov 27, 2023
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 27, 2023
@gschorcht gschorcht requested a review from benpicco November 27, 2023 16:21
@benpicco benpicco enabled auto-merge November 27, 2023 16:26
@gschorcht
Copy link
Contributor Author

@benpicco For some reason I forgot to use the idx parameter of the MTD_XFA_ADD macro as the priority. I'm pretty sure I added this in PR #19465, maybe the change got lost when I squashed it.

@riot-ci
Copy link

riot-ci commented Nov 27, 2023

Murdock results

✔️ PASSED

ff79f39 drivers/mtd: fix the order in the MTD pointer XFA

Success Failures Total Runtime
7957 0 7957 11m:27s

Artifacts

@benpicco benpicco added this pull request to the merge queue Nov 27, 2023
Merged via the queue into RIOT-OS:master with commit ad7bf85 Nov 28, 2023
27 checks passed
@gschorcht
Copy link
Contributor Author

Thanks

@gschorcht gschorcht deleted the drivers/mtd/fix_xfa branch December 7, 2023 13:03
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.01 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants