Skip to content

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

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

wedsonaf
Copy link

@wedsonaf wedsonaf commented Apr 1, 2021

No description provided.

Comment on lines -47 to +50
/// 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.
Copy link
Member

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).

Copy link
Author

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?

Copy link
Member

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).

Copy link
Author

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?

Copy link
Member

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 :-).

Comment on lines -88 to +87
/// Removes the registration from the kernel if it has completed
/// successfully before.
/// Removes the registration from the kernel if it has completed successfully before.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Comment on lines -82 to +83
// 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Member

@alex alex left a 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.

@alex alex merged commit 570300f into Rust-for-Linux:rust Apr 1, 2021
@wedsonaf wedsonaf deleted the miscdev branch April 1, 2021 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants