-
Notifications
You must be signed in to change notification settings - Fork 465
Make miscdevice
a direct field so that we can use offset_of
.
#160
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
Conversation
/// It must be pinned because the memory block that represents the | ||
/// registration is self-referential. If a minor is not given, the kernel | ||
/// allocates a new one if possible. | ||
/// It must be pinned because the memory block that represents the registration is | ||
/// self-referential. If a minor is not given, the kernel allocates a new one if possible. |
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.
Looks like an unrelated change (and makes the comment longer than 80).
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.
Are we not using 100 as the limit now?
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.
.rustfmt.toml
is still the default, so it is still 80 for comments and 100 for code, but I am OK with changing it.
Don't worry about it too much, I plan to take a look into this and cleanup everything in one go (and enforce whatever we decide) -- I mentioned it here only because it looked like an spurious change (and makes it harder to look at the diff).
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.
Whether the decision is to use 80 or 100, I think we should use it both for code and comments. It just looks silly to have code up to 100 and comments squashed at 80 on the left.
Anyway, do you really need me to re-spin this without changes to comments?
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.
I agree it is a bit weird, but it is the default. I guess the rationale is that longer comments are harder to read, but I will take a look around and find out what is usually done in most projects.
do you really need me to re-spin this without changes to comments?
If it is not trivial to do (e.g. because you will need to rebase other PRs too), then ignore it. However, in general, please try to not put unrelated changes in a commit (I am saying this for the future when we actually follow kernel's customs :-).
/// Removes the registration from the kernel if it has completed | ||
/// successfully before. | ||
/// Removes the registration from the kernel if it has completed successfully before. |
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.
Ditto.
// SAFETY: The only method is `register()`, which requires a (pinned) mutable | ||
// `Registration`, so it is safe to pass `&Registration` to multiple threads | ||
// because it offers no interior mutability. | ||
// SAFETY: The only method is `register()`, which requires a (pinned) mutable `Registration`, so it | ||
// is safe to pass `&Registration` to multiple threads because it offers no interior mutability. |
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.
Ditto.
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.
Going to merge despite the docs changes.
No description provided.