Skip to content

A number of coding style cleanups for the netcat kernel module#11

Merged
blucia0a merged 10 commits intousrbinnc:masterfrom
gregkh:codingstyle
Apr 23, 2014
Merged

A number of coding style cleanups for the netcat kernel module#11
blucia0a merged 10 commits intousrbinnc:masterfrom
gregkh:codingstyle

Conversation

@gregkh
Copy link
Contributor

@gregkh gregkh commented Apr 23, 2014

Some basic whitespace and other formatting tweaks to get the netcat kernel module
to abide by the basic Linux kernel coding style rules.

gregkh added 5 commits April 23, 2014 11:26
Linux kernel code has a specific style, so fix up the basic whitespace
issues here.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is C, not C++

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
So there's no need to do it again.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Don't rely on the 2.2 module init function naming, tell the world
exactly what the module init/exit functions are, and make them static.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Some more whitespace cleanups to make the checkpatch.pl tool happy.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@blucia0a
Copy link
Member

Thanks! Will test later today and merge these style changes in.

gregkh added 4 commits April 23, 2014 11:47
Use the "proper" pr_*() calls instead, which adds the format string
correectly.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Also put the mode in the initializer, no need to specify it later on.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
If it tries to do its own reference count, it is too late, the race
could have already happened.  That's why the kernel does it
automatically for you if you set the .owner field in the fops structure,
so do that instead.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0 is "good", -SOMETHING is always bad, no need to use a define for 0.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@gregkh
Copy link
Contributor Author

gregkh commented Apr 23, 2014

Thanks. I can add multi-user playback pretty easily on top of this patch series, no need for static variables :)

No need for forward declarations, just move the code around a bit,
saving us a number of lines.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@mark-bl
Copy link
Contributor

mark-bl commented Apr 23, 2014

After this pull request is accepted I can say I and @gregkh contributed to the same project.
For me that's a win :)

blucia0a added a commit that referenced this pull request Apr 23, 2014
A number of coding style cleanups for the netcat kernel module
@blucia0a blucia0a merged commit 0acca1a into usrbinnc:master Apr 23, 2014
@blucia0a
Copy link
Member

Thanks a lot, Greg! I would love to see how to enable multi-user playback. I haven't done much kernel hacking before, so just getting the original version built was a fun exercise.

@gregkh
Copy link
Contributor Author

gregkh commented Apr 23, 2014

Ok, I'll work on it this afternoon, should make the code a bit simpler.

And for a "first time kernel module", it's a very nice job.

@blucia0a
Copy link
Member

Thanks a lot! Glad to have your contributions to make our album release better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants