-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_04
More file actions
40 lines (34 loc) · 2.13 KB
/
task_04
File metadata and controls
40 lines (34 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
This is Task 04 of the Eudyptula Challenge
------------------------------------------
Wonderful job in making it this far. I hope you have been having fun.
Oh, you're getting bored, just booting and installing kernels? Well,
time for some pedantic things to make you feel that those kernel builds
are actually fun!
Part of the job of being a kernel developer is recognizing the proper
Linux kernel coding style. The full description of this coding style
can be found in the kernel itself, in the Documentation/CodingStyle
file. I'd recommend going and reading that right now. It's pretty
simple stuff, and something that you are going to need to know and
understand. There is also a tool in the kernel source tree in the
scripts/ directory called checkpatch.pl that can be used to test for
adhering to the coding style rules, as kernel programmers are lazy and
prefer to let scripts do their work for them...
Why a coding standard at all? Because of your brain (yes, yours, not
mine, remember, I'm just some dumb shell scripts). Once your brain
learns the patterns, the information contained really starts to sink in
better. So it's important that everyone follow the same standard so
that the patterns become consistent. In other words, you want to make
it really easy for other people to find the bugs in your code, and not
be confused and distracted by the fact that you happen to prefer 5
spaces instead of tabs for indentation. Of course you would never
prefer such a thing, I'd never accuse you of that, it was just an
example, please forgive my impertinence!
Anyway, the tasks for this round all deal with the Linux kernel coding
style. Attached to this message are two kernel modules that do not
follow the proper Linux kernel coding style rules. Please fix both of
them up, and send them back to me as attachments in your response email.
What, you recognize one of these modules? Imagine that, perhaps I was
right to accuse you of the using the "wrong" coding style :)
Yes, the logic in the second module is crazy, and probably wrong, but
don't focus on that, just look at the patterns here, and fix up the
coding style, do not remove lines of code.