0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 The tip tree handbook
0004 =====================
0005
0006 What is the tip tree?
0007 ---------------------
0008
0009 The tip tree is a collection of several subsystems and areas of
0010 development. The tip tree is both a direct development tree and a
0011 aggregation tree for several sub-maintainer trees. The tip tree gitweb URL
0012 is: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
0013
0014 The tip tree contains the following subsystems:
0015
0016 - **x86 architecture**
0017
0018 The x86 architecture development takes place in the tip tree except
0019 for the x86 KVM and XEN specific parts which are maintained in the
0020 corresponding subsystems and routed directly to mainline from
0021 there. It's still good practice to Cc the x86 maintainers on
0022 x86-specific KVM and XEN patches.
0023
0024 Some x86 subsystems have their own maintainers in addition to the
0025 overall x86 maintainers. Please Cc the overall x86 maintainers on
0026 patches touching files in arch/x86 even when they are not called out
0027 by the MAINTAINER file.
0028
0029 Note, that ``x86@kernel.org`` is not a mailing list. It is merely a
0030 mail alias which distributes mails to the x86 top-level maintainer
0031 team. Please always Cc the Linux Kernel mailing list (LKML)
0032 ``linux-kernel@vger.kernel.org``, otherwise your mail ends up only in
0033 the private inboxes of the maintainers.
0034
0035 - **Scheduler**
0036
0037 Scheduler development takes place in the -tip tree, in the
0038 sched/core branch - with occasional sub-topic trees for
0039 work-in-progress patch-sets.
0040
0041 - **Locking and atomics**
0042
0043 Locking development (including atomics and other synchronization
0044 primitives that are connected to locking) takes place in the -tip
0045 tree, in the locking/core branch - with occasional sub-topic trees
0046 for work-in-progress patch-sets.
0047
0048 - **Generic interrupt subsystem and interrupt chip drivers**:
0049
0050 - interrupt core development happens in the irq/core branch
0051
0052 - interrupt chip driver development also happens in the irq/core
0053 branch, but the patches are usually applied in a separate maintainer
0054 tree and then aggregated into irq/core
0055
0056 - **Time, timers, timekeeping, NOHZ and related chip drivers**:
0057
0058 - timekeeping, clocksource core, NTP and alarmtimer development
0059 happens in the timers/core branch, but patches are usually applied in
0060 a separate maintainer tree and then aggregated into timers/core
0061
0062 - clocksource/event driver development happens in the timers/core
0063 branch, but patches are mostly applied in a separate maintainer tree
0064 and then aggregated into timers/core
0065
0066 - **Performance counters core, architecture support and tooling**:
0067
0068 - perf core and architecture support development happens in the
0069 perf/core branch
0070
0071 - perf tooling development happens in the perf tools maintainer
0072 tree and is aggregated into the tip tree.
0073
0074 - **CPU hotplug core**
0075
0076 - **RAS core**
0077
0078 Mostly x86-specific RAS patches are collected in the tip ras/core
0079 branch.
0080
0081 - **EFI core**
0082
0083 EFI development in the efi git tree. The collected patches are
0084 aggregated in the tip efi/core branch.
0085
0086 - **RCU**
0087
0088 RCU development happens in the linux-rcu tree. The resulting changes
0089 are aggregated into the tip core/rcu branch.
0090
0091 - **Various core code components**:
0092
0093 - debugobjects
0094
0095 - objtool
0096
0097 - random bits and pieces
0098
0099
0100 Patch submission notes
0101 ----------------------
0102
0103 Selecting the tree/branch
0104 ^^^^^^^^^^^^^^^^^^^^^^^^^
0105
0106 In general, development against the head of the tip tree master branch is
0107 fine, but for the subsystems which are maintained separately, have their
0108 own git tree and are only aggregated into the tip tree, development should
0109 take place against the relevant subsystem tree or branch.
0110
0111 Bug fixes which target mainline should always be applicable against the
0112 mainline kernel tree. Potential conflicts against changes which are already
0113 queued in the tip tree are handled by the maintainers.
0114
0115 Patch subject
0116 ^^^^^^^^^^^^^
0117
0118 The tip tree preferred format for patch subject prefixes is
0119 'subsys/component:', e.g. 'x86/apic:', 'x86/mm/fault:', 'sched/fair:',
0120 'genirq/core:'. Please do not use file names or complete file paths as
0121 prefix. 'git log path/to/file' should give you a reasonable hint in most
0122 cases.
0123
0124 The condensed patch description in the subject line should start with a
0125 uppercase letter and should be written in imperative tone.
0126
0127
0128 Changelog
0129 ^^^^^^^^^
0130
0131 The general rules about changelogs in the process documentation, see
0132 :ref:`Documentation/process/ <submittingpatches>`, apply.
0133
0134 The tip tree maintainers set value on following these rules, especially on
0135 the request to write changelogs in imperative mood and not impersonating
0136 code or the execution of it. This is not just a whim of the
0137 maintainers. Changelogs written in abstract words are more precise and
0138 tend to be less confusing than those written in the form of novels.
0139
0140 It's also useful to structure the changelog into several paragraphs and not
0141 lump everything together into a single one. A good structure is to explain
0142 the context, the problem and the solution in separate paragraphs and this
0143 order.
0144
0145 Examples for illustration:
0146
0147 Example 1::
0148
0149 x86/intel_rdt/mbm: Fix MBM overflow handler during hot cpu
0150
0151 When a CPU is dying, we cancel the worker and schedule a new worker on a
0152 different CPU on the same domain. But if the timer is already about to
0153 expire (say 0.99s) then we essentially double the interval.
0154
0155 We modify the hot cpu handling to cancel the delayed work on the dying
0156 cpu and run the worker immediately on a different cpu in same domain. We
0157 donot flush the worker because the MBM overflow worker reschedules the
0158 worker on same CPU and scans the domain->cpu_mask to get the domain
0159 pointer.
0160
0161 Improved version::
0162
0163 x86/intel_rdt/mbm: Fix MBM overflow handler during CPU hotplug
0164
0165 When a CPU is dying, the overflow worker is canceled and rescheduled on a
0166 different CPU in the same domain. But if the timer is already about to
0167 expire this essentially doubles the interval which might result in a non
0168 detected overflow.
0169
0170 Cancel the overflow worker and reschedule it immediately on a different CPU
0171 in the same domain. The work could be flushed as well, but that would
0172 reschedule it on the same CPU.
0173
0174 Example 2::
0175
0176 time: POSIX CPU timers: Ensure that variable is initialized
0177
0178 If cpu_timer_sample_group returns -EINVAL, it will not have written into
0179 *sample. Checking for cpu_timer_sample_group's return value precludes the
0180 potential use of an uninitialized value of now in the following block.
0181 Given an invalid clock_idx, the previous code could otherwise overwrite
0182 *oldval in an undefined manner. This is now prevented. We also exploit
0183 short-circuiting of && to sample the timer only if the result will
0184 actually be used to update *oldval.
0185
0186 Improved version::
0187
0188 posix-cpu-timers: Make set_process_cpu_timer() more robust
0189
0190 Because the return value of cpu_timer_sample_group() is not checked,
0191 compilers and static checkers can legitimately warn about a potential use
0192 of the uninitialized variable 'now'. This is not a runtime issue as all
0193 call sites hand in valid clock ids.
0194
0195 Also cpu_timer_sample_group() is invoked unconditionally even when the
0196 result is not used because *oldval is NULL.
0197
0198 Make the invocation conditional and check the return value.
0199
0200 Example 3::
0201
0202 The entity can also be used for other purposes.
0203
0204 Let's rename it to be more generic.
0205
0206 Improved version::
0207
0208 The entity can also be used for other purposes.
0209
0210 Rename it to be more generic.
0211
0212
0213 For complex scenarios, especially race conditions and memory ordering
0214 issues, it is valuable to depict the scenario with a table which shows
0215 the parallelism and the temporal order of events. Here is an example::
0216
0217 CPU0 CPU1
0218 free_irq(X) interrupt X
0219 spin_lock(desc->lock)
0220 wake irq thread()
0221 spin_unlock(desc->lock)
0222 spin_lock(desc->lock)
0223 remove action()
0224 shutdown_irq()
0225 release_resources() thread_handler()
0226 spin_unlock(desc->lock) access released resources.
0227 ^^^^^^^^^^^^^^^^^^^^^^^^^
0228 synchronize_irq()
0229
0230 Lockdep provides similar useful output to depict a possible deadlock
0231 scenario::
0232
0233 CPU0 CPU1
0234 rtmutex_lock(&rcu->rt_mutex)
0235 spin_lock(&rcu->rt_mutex.wait_lock)
0236 local_irq_disable()
0237 spin_lock(&timer->it_lock)
0238 spin_lock(&rcu->mutex.wait_lock)
0239 --> Interrupt
0240 spin_lock(&timer->it_lock)
0241
0242
0243 Function references in changelogs
0244 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0245
0246 When a function is mentioned in the changelog, either the text body or the
0247 subject line, please use the format 'function_name()'. Omitting the
0248 brackets after the function name can be ambiguous::
0249
0250 Subject: subsys/component: Make reservation_count static
0251
0252 reservation_count is only used in reservation_stats. Make it static.
0253
0254 The variant with brackets is more precise::
0255
0256 Subject: subsys/component: Make reservation_count() static
0257
0258 reservation_count() is only called from reservation_stats(). Make it
0259 static.
0260
0261
0262 Backtraces in changelogs
0263 ^^^^^^^^^^^^^^^^^^^^^^^^
0264
0265 See :ref:`backtraces`.
0266
0267 Ordering of commit tags
0268 ^^^^^^^^^^^^^^^^^^^^^^^
0269
0270 To have a uniform view of the commit tags, the tip maintainers use the
0271 following tag ordering scheme:
0272
0273 - Fixes: 12char-SHA1 ("sub/sys: Original subject line")
0274
0275 A Fixes tag should be added even for changes which do not need to be
0276 backported to stable kernels, i.e. when addressing a recently introduced
0277 issue which only affects tip or the current head of mainline. These tags
0278 are helpful to identify the original commit and are much more valuable
0279 than prominently mentioning the commit which introduced a problem in the
0280 text of the changelog itself because they can be automatically
0281 extracted.
0282
0283 The following example illustrates the difference::
0284
0285 Commit
0286
0287 abcdef012345678 ("x86/xxx: Replace foo with bar")
0288
0289 left an unused instance of variable foo around. Remove it.
0290
0291 Signed-off-by: J.Dev <j.dev@mail>
0292
0293 Please say instead::
0294
0295 The recent replacement of foo with bar left an unused instance of
0296 variable foo around. Remove it.
0297
0298 Fixes: abcdef012345678 ("x86/xxx: Replace foo with bar")
0299 Signed-off-by: J.Dev <j.dev@mail>
0300
0301 The latter puts the information about the patch into the focus and
0302 amends it with the reference to the commit which introduced the issue
0303 rather than putting the focus on the original commit in the first place.
0304
0305 - Reported-by: ``Reporter <reporter@mail>``
0306
0307 - Originally-by: ``Original author <original-author@mail>``
0308
0309 - Suggested-by: ``Suggester <suggester@mail>``
0310
0311 - Co-developed-by: ``Co-author <co-author@mail>``
0312
0313 Signed-off: ``Co-author <co-author@mail>``
0314
0315 Note, that Co-developed-by and Signed-off-by of the co-author(s) must
0316 come in pairs.
0317
0318 - Signed-off-by: ``Author <author@mail>``
0319
0320 The first Signed-off-by (SOB) after the last Co-developed-by/SOB pair is the
0321 author SOB, i.e. the person flagged as author by git.
0322
0323 - Signed-off-by: ``Patch handler <handler@mail>``
0324
0325 SOBs after the author SOB are from people handling and transporting
0326 the patch, but were not involved in development. SOB chains should
0327 reflect the **real** route a patch took as it was propagated to us,
0328 with the first SOB entry signalling primary authorship of a single
0329 author. Acks should be given as Acked-by lines and review approvals
0330 as Reviewed-by lines.
0331
0332 If the handler made modifications to the patch or the changelog, then
0333 this should be mentioned **after** the changelog text and **above**
0334 all commit tags in the following format::
0335
0336 ... changelog text ends.
0337
0338 [ handler: Replaced foo by bar and updated changelog ]
0339
0340 First-tag: .....
0341
0342 Note the two empty new lines which separate the changelog text and the
0343 commit tags from that notice.
0344
0345 If a patch is sent to the mailing list by a handler then the author has
0346 to be noted in the first line of the changelog with::
0347
0348 From: Author <author@mail>
0349
0350 Changelog text starts here....
0351
0352 so the authorship is preserved. The 'From:' line has to be followed
0353 by a empty newline. If that 'From:' line is missing, then the patch
0354 would be attributed to the person who sent (transported, handled) it.
0355 The 'From:' line is automatically removed when the patch is applied
0356 and does not show up in the final git changelog. It merely affects
0357 the authorship information of the resulting Git commit.
0358
0359 - Tested-by: ``Tester <tester@mail>``
0360
0361 - Reviewed-by: ``Reviewer <reviewer@mail>``
0362
0363 - Acked-by: ``Acker <acker@mail>``
0364
0365 - Cc: ``cc-ed-person <person@mail>``
0366
0367 If the patch should be backported to stable, then please add a '``Cc:
0368 stable@vger.kernel.org``' tag, but do not Cc stable when sending your
0369 mail.
0370
0371 - Link: ``https://link/to/information``
0372
0373 For referring to an email on LKML or other kernel mailing lists,
0374 please use the lore.kernel.org redirector URL::
0375
0376 https://lore.kernel.org/r/email-message@id
0377
0378 The kernel.org redirector is considered a stable URL, unlike other email
0379 archives.
0380
0381 Maintainers will add a Link tag referencing the email of the patch
0382 submission when they apply a patch to the tip tree. This tag is useful
0383 for later reference and is also used for commit notifications.
0384
0385 Please do not use combined tags, e.g. ``Reported-and-tested-by``, as
0386 they just complicate automated extraction of tags.
0387
0388
0389 Links to documentation
0390 ^^^^^^^^^^^^^^^^^^^^^^
0391
0392 Providing links to documentation in the changelog is a great help to later
0393 debugging and analysis. Unfortunately, URLs often break very quickly
0394 because companies restructure their websites frequently. Non-'volatile'
0395 exceptions include the Intel SDM and the AMD APM.
0396
0397 Therefore, for 'volatile' documents, please create an entry in the kernel
0398 bugzilla https://bugzilla.kernel.org and attach a copy of these documents
0399 to the bugzilla entry. Finally, provide the URL of the bugzilla entry in
0400 the changelog.
0401
0402 Patch resend or reminders
0403 ^^^^^^^^^^^^^^^^^^^^^^^^^
0404
0405 See :ref:`resend_reminders`.
0406
0407 Merge window
0408 ^^^^^^^^^^^^
0409
0410 Please do not expect large patch series to be handled during the merge
0411 window or even during the week before. Such patches should be submitted in
0412 mergeable state *at* *least* a week before the merge window opens.
0413 Exceptions are made for bug fixes and *sometimes* for small standalone
0414 drivers for new hardware or minimally invasive patches for hardware
0415 enablement.
0416
0417 During the merge window, the maintainers instead focus on following the
0418 upstream changes, fixing merge window fallout, collecting bug fixes, and
0419 allowing themselves a breath. Please respect that.
0420
0421 The release candidate -rc1 is the starting point for new patches to be
0422 applied which are targeted for the next merge window.
0423
0424
0425 Git
0426 ^^^
0427
0428 The tip maintainers accept git pull requests from maintainers who provide
0429 subsystem changes for aggregation in the tip tree.
0430
0431 Pull requests for new patch submissions are usually not accepted and do not
0432 replace proper patch submission to the mailing list. The main reason for
0433 this is that the review workflow is email based.
0434
0435 If you submit a larger patch series it is helpful to provide a git branch
0436 in a private repository which allows interested people to easily pull the
0437 series for testing. The usual way to offer this is a git URL in the cover
0438 letter of the patch series.
0439
0440 Testing
0441 ^^^^^^^
0442
0443 Code should be tested before submitting to the tip maintainers. Anything
0444 other than minor changes should be built, booted and tested with
0445 comprehensive (and heavyweight) kernel debugging options enabled.
0446
0447 These debugging options can be found in kernel/configs/x86_debug.config
0448 and can be added to an existing kernel config by running:
0449
0450 make x86_debug.config
0451
0452 Some of these options are x86-specific and can be left out when testing
0453 on other architectures.
0454
0455 Coding style notes
0456 ------------------
0457
0458 Comment style
0459 ^^^^^^^^^^^^^
0460
0461 Sentences in comments start with an uppercase letter.
0462
0463 Single line comments::
0464
0465 /* This is a single line comment */
0466
0467 Multi-line comments::
0468
0469 /*
0470 * This is a properly formatted
0471 * multi-line comment.
0472 *
0473 * Larger multi-line comments should be split into paragraphs.
0474 */
0475
0476 No tail comments:
0477
0478 Please refrain from using tail comments. Tail comments disturb the
0479 reading flow in almost all contexts, but especially in code::
0480
0481 if (somecondition_is_true) /* Don't put a comment here */
0482 dostuff(); /* Neither here */
0483
0484 seed = MAGIC_CONSTANT; /* Nor here */
0485
0486 Use freestanding comments instead::
0487
0488 /* This condition is not obvious without a comment */
0489 if (somecondition_is_true) {
0490 /* This really needs to be documented */
0491 dostuff();
0492 }
0493
0494 /* This magic initialization needs a comment. Maybe not? */
0495 seed = MAGIC_CONSTANT;
0496
0497 Comment the important things:
0498
0499 Comments should be added where the operation is not obvious. Documenting
0500 the obvious is just a distraction::
0501
0502 /* Decrement refcount and check for zero */
0503 if (refcount_dec_and_test(&p->refcnt)) {
0504 do;
0505 lots;
0506 of;
0507 magic;
0508 things;
0509 }
0510
0511 Instead, comments should explain the non-obvious details and document
0512 constraints::
0513
0514 if (refcount_dec_and_test(&p->refcnt)) {
0515 /*
0516 * Really good explanation why the magic things below
0517 * need to be done, ordering and locking constraints,
0518 * etc..
0519 */
0520 do;
0521 lots;
0522 of;
0523 magic;
0524 /* Needs to be the last operation because ... */
0525 things;
0526 }
0527
0528 Function documentation comments:
0529
0530 To document functions and their arguments please use kernel-doc format
0531 and not free form comments::
0532
0533 /**
0534 * magic_function - Do lots of magic stuff
0535 * @magic: Pointer to the magic data to operate on
0536 * @offset: Offset in the data array of @magic
0537 *
0538 * Deep explanation of mysterious things done with @magic along
0539 * with documentation of the return values.
0540 *
0541 * Note, that the argument descriptors above are arranged
0542 * in a tabular fashion.
0543 */
0544
0545 This applies especially to globally visible functions and inline
0546 functions in public header files. It might be overkill to use kernel-doc
0547 format for every (static) function which needs a tiny explanation. The
0548 usage of descriptive function names often replaces these tiny comments.
0549 Apply common sense as always.
0550
0551
0552 Documenting locking requirements
0553 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0554 Documenting locking requirements is a good thing, but comments are not
0555 necessarily the best choice. Instead of writing::
0556
0557 /* Caller must hold foo->lock */
0558 void func(struct foo *foo)
0559 {
0560 ...
0561 }
0562
0563 Please use::
0564
0565 void func(struct foo *foo)
0566 {
0567 lockdep_assert_held(&foo->lock);
0568 ...
0569 }
0570
0571 In PROVE_LOCKING kernels, lockdep_assert_held() emits a warning
0572 if the caller doesn't hold the lock. Comments can't do that.
0573
0574 Bracket rules
0575 ^^^^^^^^^^^^^
0576
0577 Brackets should be omitted only if the statement which follows 'if', 'for',
0578 'while' etc. is truly a single line::
0579
0580 if (foo)
0581 do_something();
0582
0583 The following is not considered to be a single line statement even
0584 though C does not require brackets::
0585
0586 for (i = 0; i < end; i++)
0587 if (foo[i])
0588 do_something(foo[i]);
0589
0590 Adding brackets around the outer loop enhances the reading flow::
0591
0592 for (i = 0; i < end; i++) {
0593 if (foo[i])
0594 do_something(foo[i]);
0595 }
0596
0597
0598 Variable declarations
0599 ^^^^^^^^^^^^^^^^^^^^^
0600
0601 The preferred ordering of variable declarations at the beginning of a
0602 function is reverse fir tree order::
0603
0604 struct long_struct_name *descriptive_name;
0605 unsigned long foo, bar;
0606 unsigned int tmp;
0607 int ret;
0608
0609 The above is faster to parse than the reverse ordering::
0610
0611 int ret;
0612 unsigned int tmp;
0613 unsigned long foo, bar;
0614 struct long_struct_name *descriptive_name;
0615
0616 And even more so than random ordering::
0617
0618 unsigned long foo, bar;
0619 int ret;
0620 struct long_struct_name *descriptive_name;
0621 unsigned int tmp;
0622
0623 Also please try to aggregate variables of the same type into a single
0624 line. There is no point in wasting screen space::
0625
0626 unsigned long a;
0627 unsigned long b;
0628 unsigned long c;
0629 unsigned long d;
0630
0631 It's really sufficient to do::
0632
0633 unsigned long a, b, c, d;
0634
0635 Please also refrain from introducing line splits in variable declarations::
0636
0637 struct long_struct_name *descriptive_name = container_of(bar,
0638 struct long_struct_name,
0639 member);
0640 struct foobar foo;
0641
0642 It's way better to move the initialization to a separate line after the
0643 declarations::
0644
0645 struct long_struct_name *descriptive_name;
0646 struct foobar foo;
0647
0648 descriptive_name = container_of(bar, struct long_struct_name, member);
0649
0650
0651 Variable types
0652 ^^^^^^^^^^^^^^
0653
0654 Please use the proper u8, u16, u32, u64 types for variables which are meant
0655 to describe hardware or are used as arguments for functions which access
0656 hardware. These types are clearly defining the bit width and avoid
0657 truncation, expansion and 32/64-bit confusion.
0658
0659 u64 is also recommended in code which would become ambiguous for 32-bit
0660 kernels when 'unsigned long' would be used instead. While in such
0661 situations 'unsigned long long' could be used as well, u64 is shorter
0662 and also clearly shows that the operation is required to be 64 bits wide
0663 independent of the target CPU.
0664
0665 Please use 'unsigned int' instead of 'unsigned'.
0666
0667
0668 Constants
0669 ^^^^^^^^^
0670
0671 Please do not use literal (hexa)decimal numbers in code or initializers.
0672 Either use proper defines which have descriptive names or consider using
0673 an enum.
0674
0675
0676 Struct declarations and initializers
0677 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0678
0679 Struct declarations should align the struct member names in a tabular
0680 fashion::
0681
0682 struct bar_order {
0683 unsigned int guest_id;
0684 int ordered_item;
0685 struct menu *menu;
0686 };
0687
0688 Please avoid documenting struct members within the declaration, because
0689 this often results in strangely formatted comments and the struct members
0690 become obfuscated::
0691
0692 struct bar_order {
0693 unsigned int guest_id; /* Unique guest id */
0694 int ordered_item;
0695 /* Pointer to a menu instance which contains all the drinks */
0696 struct menu *menu;
0697 };
0698
0699 Instead, please consider using the kernel-doc format in a comment preceding
0700 the struct declaration, which is easier to read and has the added advantage
0701 of including the information in the kernel documentation, for example, as
0702 follows::
0703
0704
0705 /**
0706 * struct bar_order - Description of a bar order
0707 * @guest_id: Unique guest id
0708 * @ordered_item: The item number from the menu
0709 * @menu: Pointer to the menu from which the item
0710 * was ordered
0711 *
0712 * Supplementary information for using the struct.
0713 *
0714 * Note, that the struct member descriptors above are arranged
0715 * in a tabular fashion.
0716 */
0717 struct bar_order {
0718 unsigned int guest_id;
0719 int ordered_item;
0720 struct menu *menu;
0721 };
0722
0723 Static struct initializers must use C99 initializers and should also be
0724 aligned in a tabular fashion::
0725
0726 static struct foo statfoo = {
0727 .a = 0,
0728 .plain_integer = CONSTANT_DEFINE_OR_ENUM,
0729 .bar = &statbar,
0730 };
0731
0732 Note that while C99 syntax allows the omission of the final comma,
0733 we recommend the use of a comma on the last line because it makes
0734 reordering and addition of new lines easier, and makes such future
0735 patches slightly easier to read as well.
0736
0737 Line breaks
0738 ^^^^^^^^^^^
0739
0740 Restricting line length to 80 characters makes deeply indented code hard to
0741 read. Consider breaking out code into helper functions to avoid excessive
0742 line breaking.
0743
0744 The 80 character rule is not a strict rule, so please use common sense when
0745 breaking lines. Especially format strings should never be broken up.
0746
0747 When splitting function declarations or function calls, then please align
0748 the first argument in the second line with the first argument in the first
0749 line::
0750
0751 static int long_function_name(struct foobar *barfoo, unsigned int id,
0752 unsigned int offset)
0753 {
0754
0755 if (!id) {
0756 ret = longer_function_name(barfoo, DEFAULT_BARFOO_ID,
0757 offset);
0758 ...
0759
0760 Namespaces
0761 ^^^^^^^^^^
0762
0763 Function/variable namespaces improve readability and allow easy
0764 grepping. These namespaces are string prefixes for globally visible
0765 function and variable names, including inlines. These prefixes should
0766 combine the subsystem and the component name such as 'x86_comp\_',
0767 'sched\_', 'irq\_', and 'mutex\_'.
0768
0769 This also includes static file scope functions that are immediately put
0770 into globally visible driver templates - it's useful for those symbols
0771 to carry a good prefix as well, for backtrace readability.
0772
0773 Namespace prefixes may be omitted for local static functions and
0774 variables. Truly local functions, only called by other local functions,
0775 can have shorter descriptive names - our primary concern is greppability
0776 and backtrace readability.
0777
0778 Please note that 'xxx_vendor\_' and 'vendor_xxx_` prefixes are not
0779 helpful for static functions in vendor-specific files. After all, it
0780 is already clear that the code is vendor-specific. In addition, vendor
0781 names should only be for truly vendor-specific functionality.
0782
0783 As always apply common sense and aim for consistency and readability.
0784
0785
0786 Commit notifications
0787 --------------------
0788
0789 The tip tree is monitored by a bot for new commits. The bot sends an email
0790 for each new commit to a dedicated mailing list
0791 (``linux-tip-commits@vger.kernel.org``) and Cc's all people who are
0792 mentioned in one of the commit tags. It uses the email message ID from the
0793 Link tag at the end of the tag list to set the In-Reply-To email header so
0794 the message is properly threaded with the patch submission email.
0795
0796 The tip maintainers and submaintainers try to reply to the submitter
0797 when merging a patch, but they sometimes forget or it does not fit the
0798 workflow of the moment. While the bot message is purely mechanical, it
0799 also implies a 'Thank you! Applied.'.