Lines Matching refs:be

3 While there is much to be said for a solid and community-oriented design
5 code. It is the code which will be examined by other developers and merged
29 the standard; many developers will request that the code be reformatted
37 win before the code can be merged. Putting code into the kernel means
48 on it for other reasons, but coding style changes should not be made for
51 The coding style document also should not be read as an absolute law which
52 can never be transgressed. If there is a good reason to go against the
63 But experience has shown that excessive or premature abstraction can be
64 just as harmful as premature optimization. Abstraction should be used to
75 patches to remove unused arguments; they should, in general, not be added
79 of a driver to be used with multiple operating systems - are especially
102 should be confined to header files whenever possible.
103 Conditionally-compiled code can be confined to functions which, if the code
104 is not to be present, simply become empty. The compiler will then quietly
111 instead. The code which results will be the same, but inline functions are
124 slow execution dramatically. Inline functions, as a rule, should be quite
135 a given function should actually be inlined or not. So the liberal
136 placement of "inline" keywords may not just be excessive; it could also be
153 (now called mac80211) could be merged, a locking scheme needed to be
156 Once upon a time, Linux kernel code could be developed without thinking
161 code could be written without thinking about locking are long past.
163 Any resource (data structures, hardware registers, etc.) which could be
164 accessed concurrently by more than one thread must be protected by a lock.
165 New code should be written with this requirement in mind; retrofitting
174 One final hazard worth mentioning is this: it can be tempting to make a
178 exceptions, changes which cause regressions will be backed out if the
179 regression cannot be fixed in a timely manner. Far better to avoid the
182 It is often argued that a regression can be justified if it causes things
197 be supported indefinitely. This fact makes the creation of user-space
198 interfaces particularly challenging: since they cannot be changed in
199 incompatible ways, they must be done right the first time. For this
214 tools should be used whenever possible.
229 of these options should be turned on for any kernel used for development or
235 generated by these warnings can be verbose, but one need not worry about
245 should be used on most development kernels.
250 There are quite a few other debugging options, some of which will be
252 should not be used all of the time. But some time spent learning the
253 available options will likely be paid back many times over in short order.
262 occasion, deadlock. This kind of problem can be painful (for both
263 developers and users) in a deployed system; lockdep allows them to be found
265 locking should be run with lockdep enabled before being submitted for
271 are, probably, completely untested. Untested code tends to be broken code;
272 you could be much more confident of your code if all those error-handling
277 enabled, a configurable percentage of memory allocations will be made to
278 fail; these failures can be restricted to a specific range of code.
284 Other kinds of errors can be found with the "sparse" static analysis tool.
285 With sparse, the programmer can be warned about confusion between
288 flags is expected, and so on. Sparse must be installed separately (it can
289 be found at https://sparse.wiki.kernel.org/index.php/Main_Page if your
290 distributor does not package it); it can then be run on the code by adding
303 step. A large set of cross compilers for x86 systems can be found at
316 will be helpful for your users. In many cases, the addition of
322 effects on performance, and anything else that might be needed to
331 be formatted and what information needs to be provided.
337 Any new configuration options must be accompanied by help text which
341 specially-formatted comments; these comments can be extracted and formatted
346 comments for the future; indeed, this can be a useful activity for
348 information on how to create kerneldoc templates can be found in the file
354 merging uncommented code will be harder. That said, there is little desire
355 for verbosely-commented code. The code should, itself, be readable, with
358 Certain things should always be commented. Uses of memory barriers should
359 be accompanied by a line explaining why the barrier is necessary. The
360 locking rules for data structures generally need to be explained somewhere.
362 Non-obvious dependencies between separate bits of code should be pointed
369 The binary interface provided by the kernel to user space cannot be broken
371 programming interfaces, instead, are highly fluid and can be changed when
374 needs, that may be a sign that the API needs to change. As a kernel
377 There are, of course, some catches. API changes can be made, but they need
378 to be well justified. So any patch making an internal API change should be
380 necessary. This kind of change should also be broken out into a separate
388 say, this can be a large job, so it is best to be sure that the
394 This will help you to be sure that you have found all in-tree uses of that
397 something that kernel developers need to be worried about, but we also do
399 be.