forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 272
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
Add the General Tips page to kernel linux labs #258
Open
consra
wants to merge
1
commit into
linux-kernel-labs:master
Choose a base branch
from
consra:port_directions_page
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
============ | ||
General Tips | ||
============ | ||
|
||
Your code must not only "work", but also meet certain standards. | ||
Below are some tips for assignments, along with related penalties for non-compliance: | ||
|
||
- 0.2: compilation warnings | ||
- 0.1: 10-20 lines longer than 80 characters; | ||
- 0.2: more than 20 lines longer than 80 characters; | ||
- 0.1: duplicated code; | ||
- 0.1: magic numbers, not symbolic constants; | ||
- 0.1: identation where tabs are mixed with spaces; | ||
- 0.1: mixed line endings; | ||
- 0.1: trailing whitespace; do not leave spaces or tabs at the end of lines; | ||
- 0.1: long functions(> 150 de lines); | ||
- 0.2: very long functions (> 300 de lines); | ||
- 0.1: commented code; for debugging we recommend using a macro; | ||
- 0.1: inappropriate comments; we recommend briefly browsing the :command:`Documentation/kernel-doc-nano-HOWTO.txt` file for infomation about comment format; | ||
- 0.1: functions and variables used only locally that are not static; | ||
- 0.2: no `copy_ {to, from} _user` functions are used where needed; | ||
- 0.2: the return values of the functions are not checked; | ||
- 0.1: no relevant error codes are returned; | ||
- 0.2/-0.3: synchronization problems (-0.2 partial synchronizations, -0.3 synchronization mechanisms are missing or incorrect); | ||
- 0.1: inclusion of binary or irrelevant files in the archive; | ||
- 0.2: memory leaks; | ||
- 0.3: use of blocking operations in atomic context; | ||
|
||
You can check most style comments using | ||
`scripts/checkpatch.pl <git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl>`__, | ||
found in any Linux tree. For specific situations where you break the rules, | ||
argue with a comment or specification in the README file. | ||
|
||
Usage | ||
----- | ||
|
||
.. code-block:: console | ||
|
||
$ scripts/checkpatch.pl --no-tree --terse -f my-homework.c | ||
|
||
For more information on coding style, | ||
you can read the file `Coding Style <https://elixir.bootlin.com/linux/v4.19.19/source/Documentation/process/coding-style.rst>`__. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
use version 5.14 here