xref: /linux/.clang-format (revision 4e4bb894)
1d4ef8d3fSMiguel Ojeda# SPDX-License-Identifier: GPL-2.0
2d4ef8d3fSMiguel Ojeda#
3d4ef8d3fSMiguel Ojeda# clang-format configuration file. Intended for clang-format >= 4.
4d4ef8d3fSMiguel Ojeda#
5d4ef8d3fSMiguel Ojeda# For more information, see:
6d4ef8d3fSMiguel Ojeda#
7d4ef8d3fSMiguel Ojeda#   Documentation/process/clang-format.rst
8d4ef8d3fSMiguel Ojeda#   https://clang.llvm.org/docs/ClangFormat.html
9d4ef8d3fSMiguel Ojeda#   https://clang.llvm.org/docs/ClangFormatStyleOptions.html
10d4ef8d3fSMiguel Ojeda#
11d4ef8d3fSMiguel Ojeda---
12d4ef8d3fSMiguel OjedaAccessModifierOffset: -4
13d4ef8d3fSMiguel OjedaAlignAfterOpenBracket: Align
14d4ef8d3fSMiguel OjedaAlignConsecutiveAssignments: false
15d4ef8d3fSMiguel OjedaAlignConsecutiveDeclarations: false
16d4ef8d3fSMiguel Ojeda#AlignEscapedNewlines: Left # Unknown to clang-format-4.0
17d4ef8d3fSMiguel OjedaAlignOperands: true
18d4ef8d3fSMiguel OjedaAlignTrailingComments: false
19d4ef8d3fSMiguel OjedaAllowAllParametersOfDeclarationOnNextLine: false
20d4ef8d3fSMiguel OjedaAllowShortBlocksOnASingleLine: false
21d4ef8d3fSMiguel OjedaAllowShortCaseLabelsOnASingleLine: false
22d4ef8d3fSMiguel OjedaAllowShortFunctionsOnASingleLine: None
23d4ef8d3fSMiguel OjedaAllowShortIfStatementsOnASingleLine: false
24d4ef8d3fSMiguel OjedaAllowShortLoopsOnASingleLine: false
25d4ef8d3fSMiguel OjedaAlwaysBreakAfterDefinitionReturnType: None
26d4ef8d3fSMiguel OjedaAlwaysBreakAfterReturnType: None
27d4ef8d3fSMiguel OjedaAlwaysBreakBeforeMultilineStrings: false
28d4ef8d3fSMiguel OjedaAlwaysBreakTemplateDeclarations: false
29d4ef8d3fSMiguel OjedaBinPackArguments: true
30d4ef8d3fSMiguel OjedaBinPackParameters: true
31d4ef8d3fSMiguel OjedaBraceWrapping:
32d4ef8d3fSMiguel Ojeda  AfterClass: false
33d4ef8d3fSMiguel Ojeda  AfterControlStatement: false
34d4ef8d3fSMiguel Ojeda  AfterEnum: false
35d4ef8d3fSMiguel Ojeda  AfterFunction: true
36d4ef8d3fSMiguel Ojeda  AfterNamespace: true
37d4ef8d3fSMiguel Ojeda  AfterObjCDeclaration: false
38d4ef8d3fSMiguel Ojeda  AfterStruct: false
39d4ef8d3fSMiguel Ojeda  AfterUnion: false
40d4ef8d3fSMiguel Ojeda  #AfterExternBlock: false # Unknown to clang-format-5.0
41d4ef8d3fSMiguel Ojeda  BeforeCatch: false
42d4ef8d3fSMiguel Ojeda  BeforeElse: false
43d4ef8d3fSMiguel Ojeda  IndentBraces: false
44d4ef8d3fSMiguel Ojeda  #SplitEmptyFunction: true # Unknown to clang-format-4.0
45d4ef8d3fSMiguel Ojeda  #SplitEmptyRecord: true # Unknown to clang-format-4.0
46d4ef8d3fSMiguel Ojeda  #SplitEmptyNamespace: true # Unknown to clang-format-4.0
47d4ef8d3fSMiguel OjedaBreakBeforeBinaryOperators: None
48d4ef8d3fSMiguel OjedaBreakBeforeBraces: Custom
49d4ef8d3fSMiguel Ojeda#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
50d4ef8d3fSMiguel OjedaBreakBeforeTernaryOperators: false
51d4ef8d3fSMiguel OjedaBreakConstructorInitializersBeforeComma: false
52d4ef8d3fSMiguel Ojeda#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
53d4ef8d3fSMiguel OjedaBreakAfterJavaFieldAnnotations: false
54d4ef8d3fSMiguel OjedaBreakStringLiterals: false
55d4ef8d3fSMiguel OjedaColumnLimit: 80
56d4ef8d3fSMiguel OjedaCommentPragmas: '^ IWYU pragma:'
57d4ef8d3fSMiguel Ojeda#CompactNamespaces: false # Unknown to clang-format-4.0
58d4ef8d3fSMiguel OjedaConstructorInitializerAllOnOneLineOrOnePerLine: false
59d4ef8d3fSMiguel OjedaConstructorInitializerIndentWidth: 8
60d4ef8d3fSMiguel OjedaContinuationIndentWidth: 8
61d4ef8d3fSMiguel OjedaCpp11BracedListStyle: false
62d4ef8d3fSMiguel OjedaDerivePointerAlignment: false
63d4ef8d3fSMiguel OjedaDisableFormat: false
64d4ef8d3fSMiguel OjedaExperimentalAutoDetectBinPacking: false
65d4ef8d3fSMiguel Ojeda#FixNamespaceComments: false # Unknown to clang-format-4.0
66d4ef8d3fSMiguel Ojeda
67d4ef8d3fSMiguel Ojeda# Taken from:
68d4ef8d3fSMiguel Ojeda#   git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ \
69d4ef8d3fSMiguel Ojeda#   | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$,  - '\1'," \
70d4ef8d3fSMiguel Ojeda#   | sort | uniq
71d4ef8d3fSMiguel OjedaForEachMacros:
72d4ef8d3fSMiguel Ojeda  - 'apei_estatus_for_each_section'
73d4ef8d3fSMiguel Ojeda  - 'ata_for_each_dev'
74d4ef8d3fSMiguel Ojeda  - 'ata_for_each_link'
7599e309b6SJason Gunthorpe  - '__ata_qc_for_each'
7699e309b6SJason Gunthorpe  - 'ata_qc_for_each'
7799e309b6SJason Gunthorpe  - 'ata_qc_for_each_raw'
7899e309b6SJason Gunthorpe  - 'ata_qc_for_each_with_internal'
79d4ef8d3fSMiguel Ojeda  - 'ax25_for_each'
80d4ef8d3fSMiguel Ojeda  - 'ax25_uid_for_each'
81f16628d6SMiguel Ojeda  - '__bio_for_each_bvec'
82f16628d6SMiguel Ojeda  - 'bio_for_each_bvec'
831072c12dSOmar Sandoval  - 'bio_for_each_bvec_all'
84d4ef8d3fSMiguel Ojeda  - 'bio_for_each_integrity_vec'
85d4ef8d3fSMiguel Ojeda  - '__bio_for_each_segment'
86d4ef8d3fSMiguel Ojeda  - 'bio_for_each_segment'
87d4ef8d3fSMiguel Ojeda  - 'bio_for_each_segment_all'
88d4ef8d3fSMiguel Ojeda  - 'bio_list_for_each'
89d4ef8d3fSMiguel Ojeda  - 'bip_for_each_vec'
9011a4a8f7SMiguel Ojeda  - 'bitmap_for_each_clear_region'
9111a4a8f7SMiguel Ojeda  - 'bitmap_for_each_set_region'
92d4ef8d3fSMiguel Ojeda  - 'blkg_for_each_descendant_post'
93d4ef8d3fSMiguel Ojeda  - 'blkg_for_each_descendant_pre'
94d4ef8d3fSMiguel Ojeda  - 'blk_queue_for_each_rl'
95d4ef8d3fSMiguel Ojeda  - 'bond_for_each_slave'
96d4ef8d3fSMiguel Ojeda  - 'bond_for_each_slave_rcu'
9799e309b6SJason Gunthorpe  - 'bpf_for_each_spilled_reg'
98d4ef8d3fSMiguel Ojeda  - 'btree_for_each_safe128'
99d4ef8d3fSMiguel Ojeda  - 'btree_for_each_safe32'
100d4ef8d3fSMiguel Ojeda  - 'btree_for_each_safe64'
101d4ef8d3fSMiguel Ojeda  - 'btree_for_each_safel'
102d4ef8d3fSMiguel Ojeda  - 'card_for_each_dev'
103d4ef8d3fSMiguel Ojeda  - 'cgroup_taskset_for_each'
104d4ef8d3fSMiguel Ojeda  - 'cgroup_taskset_for_each_leader'
105d4ef8d3fSMiguel Ojeda  - 'cpufreq_for_each_entry'
106d4ef8d3fSMiguel Ojeda  - 'cpufreq_for_each_entry_idx'
107d4ef8d3fSMiguel Ojeda  - 'cpufreq_for_each_valid_entry'
108d4ef8d3fSMiguel Ojeda  - 'cpufreq_for_each_valid_entry_idx'
109d4ef8d3fSMiguel Ojeda  - 'css_for_each_child'
110d4ef8d3fSMiguel Ojeda  - 'css_for_each_descendant_post'
111d4ef8d3fSMiguel Ojeda  - 'css_for_each_descendant_pre'
112d4ef8d3fSMiguel Ojeda  - 'device_for_each_child_node'
11352d08347SMiguel Ojeda  - 'dma_fence_chain_for_each'
114*4e4bb894SMiguel Ojeda  - 'do_for_each_ftrace_op'
115d4ef8d3fSMiguel Ojeda  - 'drm_atomic_crtc_for_each_plane'
116d4ef8d3fSMiguel Ojeda  - 'drm_atomic_crtc_state_for_each_plane'
117d4ef8d3fSMiguel Ojeda  - 'drm_atomic_crtc_state_for_each_plane_state'
11899e309b6SJason Gunthorpe  - 'drm_atomic_for_each_plane_damage'
11952d08347SMiguel Ojeda  - 'drm_client_for_each_connector_iter'
12052d08347SMiguel Ojeda  - 'drm_client_for_each_modeset'
12199e309b6SJason Gunthorpe  - 'drm_connector_for_each_possible_encoder'
12211a4a8f7SMiguel Ojeda  - 'drm_for_each_bridge_in_chain'
123d4ef8d3fSMiguel Ojeda  - 'drm_for_each_connector_iter'
124d4ef8d3fSMiguel Ojeda  - 'drm_for_each_crtc'
125d4ef8d3fSMiguel Ojeda  - 'drm_for_each_encoder'
126d4ef8d3fSMiguel Ojeda  - 'drm_for_each_encoder_mask'
127d4ef8d3fSMiguel Ojeda  - 'drm_for_each_fb'
128d4ef8d3fSMiguel Ojeda  - 'drm_for_each_legacy_plane'
129d4ef8d3fSMiguel Ojeda  - 'drm_for_each_plane'
130d4ef8d3fSMiguel Ojeda  - 'drm_for_each_plane_mask'
131f16628d6SMiguel Ojeda  - 'drm_for_each_privobj'
132d4ef8d3fSMiguel Ojeda  - 'drm_mm_for_each_hole'
133d4ef8d3fSMiguel Ojeda  - 'drm_mm_for_each_node'
134d4ef8d3fSMiguel Ojeda  - 'drm_mm_for_each_node_in_range'
135d4ef8d3fSMiguel Ojeda  - 'drm_mm_for_each_node_safe'
136f16628d6SMiguel Ojeda  - 'flow_action_for_each'
13752d08347SMiguel Ojeda  - 'for_each_active_dev_scope'
138d4ef8d3fSMiguel Ojeda  - 'for_each_active_drhd_unit'
139d4ef8d3fSMiguel Ojeda  - 'for_each_active_iommu'
140*4e4bb894SMiguel Ojeda  - 'for_each_aggr_pgid'
141d4ef8d3fSMiguel Ojeda  - 'for_each_available_child_of_node'
142d4ef8d3fSMiguel Ojeda  - 'for_each_bio'
143d4ef8d3fSMiguel Ojeda  - 'for_each_board_func_rsrc'
144