1 # SPDX-License-Identifier: GPL-2.0
3 # clang-format configuration file. Intended for clang-format >= 4.
5 # For more information, see:
7 # Documentation/process/clang-format.rst
8 # https://clang.llvm.org/docs/ClangFormat.html
9 # https://clang.llvm.org/docs/ClangFormatStyleOptions.html
12 AccessModifierOffset: -4
13 AlignAfterOpenBracket: Align
14 AlignConsecutiveAssignments: false
15 AlignConsecutiveDeclarations: false
16 #AlignEscapedNewlines: Left # Unknown to clang-format-4.0
18 AlignTrailingComments: false
19 AllowAllParametersOfDeclarationOnNextLine: false
20 AllowShortBlocksOnASingleLine: false
21 AllowShortCaseLabelsOnASingleLine: false
22 AllowShortFunctionsOnASingleLine: None
23 AllowShortIfStatementsOnASingleLine: false
24 AllowShortLoopsOnASingleLine: false
25 AlwaysBreakAfterDefinitionReturnType: None
26 AlwaysBreakAfterReturnType: None
27 AlwaysBreakBeforeMultilineStrings: false
28 AlwaysBreakTemplateDeclarations: false
29 BinPackArguments: true
30 BinPackParameters: true
33 AfterControlStatement: false
37 AfterObjCDeclaration: false
40 #AfterExternBlock: false # Unknown to clang-format-5.0
44 #SplitEmptyFunction: true # Unknown to clang-format-4.0
45 #SplitEmptyRecord: true # Unknown to clang-format-4.0
46 #SplitEmptyNamespace: true # Unknown to clang-format-4.0
47 BreakBeforeBinaryOperators: None
48 BreakBeforeBraces: Custom
49 #BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
50 BreakBeforeTernaryOperators: false
51 BreakConstructorInitializersBeforeComma: false
52 #BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
53 BreakAfterJavaFieldAnnotations: false
54 BreakStringLiterals: false
56 CommentPragmas: '^ IWYU pragma:'
57 #CompactNamespaces: false # Unknown to clang-format-4.0
58 ConstructorInitializerAllOnOneLineOrOnePerLine: false
59 ConstructorInitializerIndentWidth: 8
60 ContinuationIndentWidth: 8
61 Cpp11BracedListStyle: false
62 DerivePointerAlignment: false
64 ExperimentalAutoDetectBinPacking: false
65 #FixNamespaceComments: false # Unknown to clang-format-4.0
68 # git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ \
69 # | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
72 - 'apei_estatus_for_each_section'
77 - 'ata_qc_for_each_raw'
78 - 'ata_qc_for_each_with_internal'
81 - 'bio_for_each_integrity_vec'
82 - '__bio_for_each_segment'
83 - 'bio_for_each_segment'
84 - 'bio_for_each_segment_all'
87 - 'blkg_for_each_descendant_post'
88 - 'blkg_for_each_descendant_pre'
89 - 'blk_queue_for_each_rl'
90 - 'bond_for_each_slave'
91 - 'bond_for_each_slave_rcu'
92 - 'bpf_for_each_spilled_reg'
93 - 'btree_for_each_safe128'
94 - 'btree_for_each_safe32'
95 - 'btree_for_each_safe64'
96 - 'btree_for_each_safel'
98 - 'cgroup_taskset_for_each'
99 - 'cgroup_taskset_for_each_leader'
100 - 'cpufreq_for_each_entry'
101 - 'cpufreq_for_each_entry_idx'
102 - 'cpufreq_for_each_valid_entry'
103 - 'cpufreq_for_each_valid_entry_idx'
104 - 'css_for_each_child'
105 - 'css_for_each_descendant_post'
106 - 'css_for_each_descendant_pre'
107 - 'device_for_each_child_node'
108 - 'drm_atomic_crtc_for_each_plane'
109 - 'drm_atomic_crtc_state_for_each_plane'
110 - 'drm_atomic_crtc_state_for_each_plane_state'
111 - 'drm_atomic_for_each_plane_damage'
112 - 'drm_connector_for_each_possible_encoder'
113 - 'drm_for_each_connector_iter'
114 - 'drm_for_each_crtc'
115 - 'drm_for_each_encoder'
116 - 'drm_for_each_encoder_mask'
118 - 'drm_for_each_legacy_plane'
119 - 'drm_for_each_plane'
120 - 'drm_for_each_plane_mask'
121 - 'drm_mm_for_each_hole'
122 - 'drm_mm_for_each_node'
123 - 'drm_mm_for_each_node_in_range'
124 - 'drm_mm_for_each_node_safe'
125 - 'for_each_active_drhd_unit'
126 - 'for_each_active_iommu'
127 - 'for_each_available_child_of_node'
129 - 'for_each_board_func_rsrc'
131 - 'for_each_card_components'
132 - 'for_each_card_links'
133 - 'for_each_card_links_safe'
134 - 'for_each_card_prelinks'
135 - 'for_each_card_rtds'
136 - 'for_each_card_rtds_safe'
137 - 'for_each_cgroup_storage_type'
138 - 'for_each_child_of_node'
139 - 'for_each_clear_bit'
140 - 'for_each_clear_bit_from'
142 - 'for_each_compatible_node'
143 - 'for_each_component_dais'
144 - 'for_each_component_dais_safe'
145 - 'for_each_comp_order'
150 - 'for_each_cpu_wrap'
151 - 'for_each_dev_addr'
152 - 'for_each_dma_cap_mask'
154 - 'for_each_dpcm_be_rollback'
155 - 'for_each_dpcm_be_safe'
157 - 'for_each_drhd_unit'
159 - 'for_each_efi_memory_desc'
160 - 'for_each_efi_memory_desc_in_map'
161 - 'for_each_endpoint_of_node'
162 - 'for_each_evictable_lru'
163 - 'for_each_fib6_node_rt_rcu'
164 - 'for_each_fib6_walker_rt'
165 - 'for_each_free_mem_range'
166 - 'for_each_free_mem_range_reverse'
167 - 'for_each_func_rsrc'
171 - 'for_each_ip_tunnel_rcu'
173 - 'for_each_link_codecs'
175 - 'for_each_matching_node'
176 - 'for_each_matching_node_and_match'
177 - 'for_each_memblock'
178 - 'for_each_memblock_type'
179 - 'for_each_memcg_cache_index'
180 - 'for_each_mem_pfn_range'
181 - 'for_each_mem_range'
182 - 'for_each_mem_range_rev'
183 - 'for_each_migratetype_order'
184 - 'for_each_msi_entry'
185 - 'for_each_msi_entry_safe'
188 - 'for_each_netdev_continue'
189 - 'for_each_netdev_continue_rcu'
190 - 'for_each_netdev_feature'
191 - 'for_each_netdev_in_bond_rcu'
192 - 'for_each_netdev_rcu'
193 - 'for_each_netdev_reverse'
194 - 'for_each_netdev_safe'
196 - 'for_each_new_connector_in_state'
197 - 'for_each_new_crtc_in_state'
198 - 'for_each_new_plane_in_state'
199 - 'for_each_new_private_obj_in_state'
201 - 'for_each_node_by_name'
202 - 'for_each_node_by_type'
203 - 'for_each_node_mask'
204 - 'for_each_node_state'
205 - 'for_each_node_with_cpus'
206 - 'for_each_node_with_property'
207 - 'for_each_of_allnodes'
208 - 'for_each_of_allnodes_from'
209 - 'for_each_of_cpu_node'
210 - 'for_each_of_pci_range'
211 - 'for_each_old_connector_in_state'
212 - 'for_each_old_crtc_in_state'
213 - 'for_each_oldnew_connector_in_state'
214 - 'for_each_oldnew_crtc_in_state'
215 - 'for_each_oldnew_plane_in_state'
216 - 'for_each_oldnew_plane_in_state_reverse'
217 - 'for_each_oldnew_private_obj_in_state'
218 - 'for_each_old_plane_in_state'
219 - 'for_each_old_private_obj_in_state'
220 - 'for_each_online_cpu'
221 - 'for_each_online_node'
222 - 'for_each_online_pgdat'
223 - 'for_each_pci_bridge'
225 - 'for_each_pci_msi_entry'
226 - 'for_each_populated_zone'
227 - 'for_each_possible_cpu'
228 - 'for_each_present_cpu'
229 - 'for_each_prime_number'
230 - 'for_each_prime_number_from'
232 - 'for_each_process_thread'
233 - 'for_each_property_of_node'
234 - 'for_each_registered_fb'
235 - 'for_each_reserved_mem_region'
236 - 'for_each_rtd_codec_dai'
237 - 'for_each_rtd_codec_dai_rollback'
239 - 'for_each_rtdcom_safe'
241 - 'for_each_set_bit_from'
243 - 'for_each_sg_dma_page'
245 - 'for_each_sibling_event'
246 - '__for_each_thread'
249 - 'for_each_zone_zonelist'
250 - 'for_each_zone_zonelist_nodemask'
251 - 'fwnode_for_each_available_child_node'
252 - 'fwnode_for_each_child_node'
253 - 'fwnode_graph_for_each_endpoint'
254 - 'gadget_for_each_ep'
256 - 'hash_for_each_possible'
257 - 'hash_for_each_possible_rcu'
258 - 'hash_for_each_possible_rcu_notrace'
259 - 'hash_for_each_possible_safe'
260 - 'hash_for_each_rcu'
261 - 'hash_for_each_safe'
262 - 'hctx_for_each_ctx'
263 - 'hlist_bl_for_each_entry'
264 - 'hlist_bl_for_each_entry_rcu'
265 - 'hlist_bl_for_each_entry_safe'
267 - 'hlist_for_each_entry'
268 - 'hlist_for_each_entry_continue'
269 - 'hlist_for_each_entry_continue_rcu'
270 - 'hlist_for_each_entry_continue_rcu_bh'
271 - 'hlist_for_each_entry_from'
272 - 'hlist_for_each_entry_from_rcu'
273 - 'hlist_for_each_entry_rcu'
274 - 'hlist_for_each_entry_rcu_bh'
275 - 'hlist_for_each_entry_rcu_notrace'
276 - 'hlist_for_each_entry_safe'
277 - '__hlist_for_each_rcu'
278 - 'hlist_for_each_safe'
279 - 'hlist_nulls_for_each_entry'
280 - 'hlist_nulls_for_each_entry_from'
281 - 'hlist_nulls_for_each_entry_rcu'
282 - 'hlist_nulls_for_each_entry_safe'
283 - 'i3c_bus_for_each_i2cdev'
284 - 'i3c_bus_for_each_i3cdev'
285 - 'ide_host_for_each_port'
286 - 'ide_port_for_each_dev'
287 - 'ide_port_for_each_present_dev'
288 - 'idr_for_each_entry'
289 - 'idr_for_each_entry_continue'
290 - 'idr_for_each_entry_ul'
291 - 'inet_bind_bucket_for_each'
292 - 'inet_lhash2_for_each_icsk_rcu'
294 - 'key_for_each_safe'
295 - 'klp_for_each_func'
296 - 'klp_for_each_object'
297 - 'kvm_for_each_memslot'
298 - 'kvm_for_each_vcpu'
300 - 'list_for_each_codec'
301 - 'list_for_each_codec_safe'
302 - 'list_for_each_entry'
303 - 'list_for_each_entry_continue'
304 - 'list_for_each_entry_continue_rcu'
305 - 'list_for_each_entry_continue_reverse'
306 - 'list_for_each_entry_from'
307 - 'list_for_each_entry_from_rcu'
308 - 'list_for_each_entry_from_reverse'
309 - 'list_for_each_entry_lockless'
310 - 'list_for_each_entry_rcu'
311 - 'list_for_each_entry_reverse'
312 - 'list_for_each_entry_safe'
313 - 'list_for_each_entry_safe_continue'
314 - 'list_for_each_entry_safe_from'
315 - 'list_for_each_entry_safe_reverse'
316 - 'list_for_each_prev'
317 - 'list_for_each_prev_safe'
318 - 'list_for_each_safe'
320 - 'llist_for_each_entry'
321 - 'llist_for_each_entry_safe'
322 - 'llist_for_each_safe'
323 - 'media_device_for_each_entity'
324 - 'media_device_for_each_intf'
325 - 'media_device_for_each_link'
326 - 'media_device_for_each_pad'
327 - 'nanddev_io_for_each_page'
328 - 'netdev_for_each_lower_dev'
329 - 'netdev_for_each_lower_private'
330 - 'netdev_for_each_lower_private_rcu'
331 - 'netdev_for_each_mc_addr'
332 - 'netdev_for_each_uc_addr'
333 - 'netdev_for_each_upper_dev_rcu'
334 - 'netdev_hw_addr_list_for_each'
335 - 'nft_rule_for_each_expr'
336 - 'nla_for_each_attr'
337 - 'nla_for_each_nested'
338 - 'nlmsg_for_each_attr'
339 - 'nlmsg_for_each_msg'
340 - 'nr_neigh_for_each'
341 - 'nr_neigh_for_each_safe'
343 - 'nr_node_for_each_safe'
344 - 'of_for_each_phandle'
345 - 'of_property_for_each_string'
346 - 'of_property_for_each_u32'
347 - 'pci_bus_for_each_resource'
348 - 'ping_portaddr_for_each_entry'
350 - 'plist_for_each_continue'
351 - 'plist_for_each_entry'
352 - 'plist_for_each_entry_continue'
353 - 'plist_for_each_entry_safe'
354 - 'plist_for_each_safe'
355 - 'pnp_for_each_card'
357 - 'protocol_for_each_card'
358 - 'protocol_for_each_dev'
359 - 'queue_for_each_hw_ctx'
360 - 'radix_tree_for_each_slot'
361 - 'radix_tree_for_each_tagged'
362 - 'rbtree_postorder_for_each_entry_safe'
363 - 'rdma_for_each_port'
364 - 'resource_list_for_each_entry'
365 - 'resource_list_for_each_entry_safe'
366 - 'rhl_for_each_entry_rcu'
369 - 'rht_for_each_continue'
370 - 'rht_for_each_entry'
371 - 'rht_for_each_entry_continue'
372 - 'rht_for_each_entry_rcu'
373 - 'rht_for_each_entry_rcu_continue'
374 - 'rht_for_each_entry_safe'
376 - 'rht_for_each_rcu_continue'
377 - '__rq_for_each_bio'
378 - 'rq_for_each_segment'
379 - 'scsi_for_each_prot_sg'
381 - 'sctp_for_each_hentry'
382 - 'sctp_skb_for_each'
383 - 'shdma_for_each_chan'
384 - '__shost_for_each_device'
385 - 'shost_for_each_device'
387 - 'sk_for_each_bound'
388 - 'sk_for_each_entry_offset_rcu'
392 - 'sk_nulls_for_each'
393 - 'sk_nulls_for_each_from'
394 - 'sk_nulls_for_each_rcu'
395 - 'snd_array_for_each'
396 - 'snd_pcm_group_for_each_entry'
397 - 'snd_soc_dapm_widget_for_each_path'
398 - 'snd_soc_dapm_widget_for_each_path_safe'
399 - 'snd_soc_dapm_widget_for_each_sink_path'
400 - 'snd_soc_dapm_widget_for_each_source_path'
401 - 'tb_property_for_each'
402 - 'tcf_exts_for_each_action'
403 - 'udp_portaddr_for_each_entry'
404 - 'udp_portaddr_for_each_entry_rcu'
405 - 'usb_hub_for_each_child'
406 - 'v4l2_device_for_each_subdev'
407 - 'v4l2_m2m_for_each_dst_buf'
408 - 'v4l2_m2m_for_each_dst_buf_safe'
409 - 'v4l2_m2m_for_each_src_buf'
410 - 'v4l2_m2m_for_each_src_buf_safe'
411 - 'virtio_device_for_each_vq'
414 - 'xas_for_each_conflict'
415 - 'xas_for_each_marked'
416 - 'zorro_for_each_dev'
418 #IncludeBlocks: Preserve # Unknown to clang-format-5.0
422 IncludeIsMainRegex: '(Test)?$'
423 IndentCaseLabels: false
424 #IndentPPDirectives: None # Unknown to clang-format-5.0
426 IndentWrappedFunctionNames: false
427 JavaScriptQuotes: Leave
428 JavaScriptWrapImports: true
429 KeepEmptyLinesAtTheStartOfBlocks: false
432 MaxEmptyLinesToKeep: 1
433 NamespaceIndentation: Inner
434 #ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
435 ObjCBlockIndentWidth: 8
436 ObjCSpaceAfterProperty: true
437 ObjCSpaceBeforeProtocolList: true
439 # Taken from git's rules
440 #PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
441 PenaltyBreakBeforeFirstCallParameter: 30
442 PenaltyBreakComment: 10
443 PenaltyBreakFirstLessLess: 0
444 PenaltyBreakString: 10
445 PenaltyExcessCharacter: 100
446 PenaltyReturnTypeOnItsOwnLine: 60
448 PointerAlignment: Right
449 ReflowComments: false
451 #SortUsingDeclarations: false # Unknown to clang-format-4.0
452 SpaceAfterCStyleCast: false
453 SpaceAfterTemplateKeyword: true
454 SpaceBeforeAssignmentOperators: true
455 #SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
456 #SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
457 SpaceBeforeParens: ControlStatements
458 #SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
459 SpaceInEmptyParentheses: false
460 SpacesBeforeTrailingComments: 1
461 SpacesInAngles: false
462 SpacesInContainerLiterals: false
463 SpacesInCStyleCastParentheses: false
464 SpacesInParentheses: false
465 SpacesInSquareBrackets: false