-
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
cpu/native/can/candev_linux: add check for real can #13342
Conversation
@wysman can you elaborate on why and how this fix works? |
@kaspar030 I guess you meant to tag me instead of wysman? I wrote down my entire thoughtprocess in #13309. Also: I think this patch is how it was originally intended I think, because on line 305 the exact same check is done when calling _set_bitrate. It was probably overlooked at the time of writing. |
Yes :) sorry @wysman. Thanks for the detailed explanation. Could you add a short comment, as in, |
0be9402
to
3b58df5
Compare
@kaspar030 : Sure, done! |
I didn't remember there was this check already in the code. This looks a bit hacky to me because it relies on the name, and I can create a virtual CAN called |
Fair point @vincent-d . Maybe we should add some warning for it in the readme? |
@kaspar030 : what do you think? Add the extra warning, or merge straight away? |
otherwise this looks good to me |
64f3a9c
to
70d6953
Compare
I squashed the commits to make Travis happy. (He complained about the length of the commit-message) |
70d6953
to
d477b5b
Compare
CI issue seems to be fixed. Ready to ACK? |
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.
ACK.
Contribution description
This is the fix I proposed in #13309. Like I said there: it's still up for debate whether this fix is the one we want/need, or if there is something else that needs patching (because it's possible that this patch only suppresses the symptoms, and does not address the root cause).
Anyhow, for me it seems it does not break conn_can (which, as far as I can tell is currently the only app using the code that is altered by this PR), and it does fix the issue for other uses of the candev_native.
Also: it makes this function call consistent with other calls, because the same check is done before these others (see line 305 in candev_linux.c).
And even more so: it makes conn_can compliant with its own "rules".
Testing procedure
Issues/PRs references
Fixes #13309.