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_bvec'
83 - 'bio_for_each_bvec_all'
84 - 'bio_for_each_integrity_vec'
85 - '__bio_for_each_segment'
86 - 'bio_for_each_segment'
87 - 'bio_for_each_segment_all'
90 - 'bitmap_for_each_clear_region'
91 - 'bitmap_for_each_set_region'
92 - 'blkg_for_each_descendant_post'
93 - 'blkg_for_each_descendant_pre'
94 - 'blk_queue_for_each_rl'
95 - 'bond_for_each_slave'
96 - 'bond_for_each_slave_rcu'
97 - 'bpf_for_each_spilled_reg'
98 - 'btree_for_each_safe128'
99 - 'btree_for_each_safe32'
100 - 'btree_for_each_safe64'
101 - 'btree_for_each_safel'
102 - 'card_for_each_dev'
103 - 'cgroup_taskset_for_each'
104 - 'cgroup_taskset_for_each_leader'
105 - 'cpufreq_for_each_entry'
106 - 'cpufreq_for_each_entry_idx'
107 - 'cpufreq_for_each_valid_entry'
108 - 'cpufreq_for_each_valid_entry_idx'
109 - 'css_for_each_child'
110 - 'css_for_each_descendant_post'
111 - 'css_for_each_descendant_pre'
113 - 'device_for_each_child_node'
114 - 'dma_fence_chain_for_each'
115 - 'do_for_each_ftrace_op'
116 - 'drm_atomic_crtc_for_each_plane'
117 - 'drm_atomic_crtc_state_for_each_plane'
118 - 'drm_atomic_crtc_state_for_each_plane_state'
119 - 'drm_atomic_for_each_plane_damage'
120 - 'drm_client_for_each_connector_iter'
121 - 'drm_client_for_each_modeset'
122 - 'drm_connector_for_each_possible_encoder'
123 - 'drm_for_each_bridge_in_chain'
124 - 'drm_for_each_connector_iter'
125 - 'drm_for_each_crtc'
126 - 'drm_for_each_crtc_reverse'
127 - 'drm_for_each_encoder'
128 - 'drm_for_each_encoder_mask'
130 - 'drm_for_each_legacy_plane'
131 - 'drm_for_each_plane'
132 - 'drm_for_each_plane_mask'
133 - 'drm_for_each_privobj'
134 - 'drm_mm_for_each_hole'
135 - 'drm_mm_for_each_node'
136 - 'drm_mm_for_each_node_in_range'
137 - 'drm_mm_for_each_node_safe'
138 - 'flow_action_for_each'
139 - 'for_each_active_dev_scope'
140 - 'for_each_active_drhd_unit'
141 - 'for_each_active_iommu'
142 - 'for_each_aggr_pgid'
143 - 'for_each_available_child_of_node'
145 - 'for_each_board_func_rsrc'
147 - 'for_each_card_auxs'
148 - 'for_each_card_auxs_safe'
149 - 'for_each_card_components'
150 - 'for_each_card_dapms'
151 - 'for_each_card_pre_auxs'
152 - 'for_each_card_prelinks'
153 - 'for_each_card_rtds'
154 - 'for_each_card_rtds_safe'
155 - 'for_each_card_widgets'
156 - 'for_each_card_widgets_safe'
157 - 'for_each_cgroup_storage_type'
158 - 'for_each_child_of_node'
159 - 'for_each_clear_bit'
160 - 'for_each_clear_bit_from'
162 - 'for_each_compatible_node'
163 - 'for_each_component_dais'
164 - 'for_each_component_dais_safe'
165 - 'for_each_comp_order'
170 - 'for_each_cpu_wrap'
171 - 'for_each_dapm_widgets'
172 - 'for_each_dev_addr'
173 - 'for_each_dev_scope'
174 - 'for_each_displayid_db'
175 - 'for_each_dma_cap_mask'
177 - 'for_each_dpcm_be_rollback'
178 - 'for_each_dpcm_be_safe'
180 - 'for_each_drhd_unit'
182 - 'for_each_efi_memory_desc'
183 - 'for_each_efi_memory_desc_in_map'
185 - 'for_each_element_extid'
186 - 'for_each_element_id'
187 - 'for_each_endpoint_of_node'
188 - 'for_each_evictable_lru'
189 - 'for_each_fib6_node_rt_rcu'
190 - 'for_each_fib6_walker_rt'
191 - 'for_each_free_mem_pfn_range_in_zone'
192 - 'for_each_free_mem_pfn_range_in_zone_from'
193 - 'for_each_free_mem_range'
194 - 'for_each_free_mem_range_reverse'
195 - 'for_each_func_rsrc'
199 - 'for_each_ip_tunnel_rcu'
201 - 'for_each_link_codecs'
202 - 'for_each_link_cpus'
203 - 'for_each_link_platforms'
205 - 'for_each_matching_node'
206 - 'for_each_matching_node_and_match'
208 - 'for_each_memcg_cache_index'
209 - 'for_each_mem_pfn_range'
210 - '__for_each_mem_range'
211 - 'for_each_mem_range'
212 - '__for_each_mem_range_rev'
213 - 'for_each_mem_range_rev'
214 - 'for_each_mem_region'
215 - 'for_each_migratetype_order'
216 - 'for_each_msi_entry'
217 - 'for_each_msi_entry_safe'
219 - 'for_each_net_continue_reverse'
221 - 'for_each_netdev_continue'
222 - 'for_each_netdev_continue_rcu'
223 - 'for_each_netdev_continue_reverse'
224 - 'for_each_netdev_feature'
225 - 'for_each_netdev_in_bond_rcu'
226 - 'for_each_netdev_rcu'
227 - 'for_each_netdev_reverse'
228 - 'for_each_netdev_safe'
230 - 'for_each_new_connector_in_state'
231 - 'for_each_new_crtc_in_state'
232 - 'for_each_new_mst_mgr_in_state'
233 - 'for_each_new_plane_in_state'
234 - 'for_each_new_private_obj_in_state'
236 - 'for_each_node_by_name'
237 - 'for_each_node_by_type'
238 - 'for_each_node_mask'
239 - 'for_each_node_state'
240 - 'for_each_node_with_cpus'
241 - 'for_each_node_with_property'
242 - 'for_each_nonreserved_multicast_dest_pgid'
243 - 'for_each_of_allnodes'
244 - 'for_each_of_allnodes_from'
245 - 'for_each_of_cpu_node'
246 - 'for_each_of_pci_range'
247 - 'for_each_old_connector_in_state'
248 - 'for_each_old_crtc_in_state'
249 - 'for_each_old_mst_mgr_in_state'
250 - 'for_each_oldnew_connector_in_state'
251 - 'for_each_oldnew_crtc_in_state'
252 - 'for_each_oldnew_mst_mgr_in_state'
253 - 'for_each_oldnew_plane_in_state'
254 - 'for_each_oldnew_plane_in_state_reverse'
255 - 'for_each_oldnew_private_obj_in_state'
256 - 'for_each_old_plane_in_state'
257 - 'for_each_old_private_obj_in_state'
258 - 'for_each_online_cpu'
259 - 'for_each_online_node'
260 - 'for_each_online_pgdat'
261 - 'for_each_pci_bridge'
263 - 'for_each_pci_msi_entry'
264 - 'for_each_pcm_streams'
265 - 'for_each_physmem_range'
266 - 'for_each_populated_zone'
267 - 'for_each_possible_cpu'
268 - 'for_each_present_cpu'
269 - 'for_each_prime_number'
270 - 'for_each_prime_number_from'
272 - 'for_each_process_thread'
273 - 'for_each_property_of_node'
274 - 'for_each_registered_fb'
275 - 'for_each_requested_gpio'
276 - 'for_each_requested_gpio_in_range'
277 - 'for_each_reserved_mem_range'
278 - 'for_each_reserved_mem_region'
279 - 'for_each_rtd_codec_dais'
280 - 'for_each_rtd_components'
281 - 'for_each_rtd_cpu_dais'
282 - 'for_each_rtd_dais'
284 - 'for_each_set_bit_from'
285 - 'for_each_set_clump8'
287 - 'for_each_sg_dma_page'
289 - 'for_each_sgtable_dma_page'
290 - 'for_each_sgtable_dma_sg'
291 - 'for_each_sgtable_page'
292 - 'for_each_sgtable_sg'
293 - 'for_each_sibling_event'
294 - 'for_each_subelement'
295 - 'for_each_subelement_extid'
296 - 'for_each_subelement_id'
297 - '__for_each_thread'
299 - 'for_each_unicast_dest_pgid'
301 - 'for_each_wakeup_source'
303 - 'for_each_zone_zonelist'
304 - 'for_each_zone_zonelist_nodemask'
305 - 'fwnode_for_each_available_child_node'
306 - 'fwnode_for_each_child_node'
307 - 'fwnode_graph_for_each_endpoint'
308 - 'gadget_for_each_ep'
309 - 'genradix_for_each'
310 - 'genradix_for_each_from'
312 - 'hash_for_each_possible'
313 - 'hash_for_each_possible_rcu'
314 - 'hash_for_each_possible_rcu_notrace'
315 - 'hash_for_each_possible_safe'
316 - 'hash_for_each_rcu'
317 - 'hash_for_each_safe'
318 - 'hctx_for_each_ctx'
319 - 'hlist_bl_for_each_entry'
320 - 'hlist_bl_for_each_entry_rcu'
321 - 'hlist_bl_for_each_entry_safe'
323 - 'hlist_for_each_entry'
324 - 'hlist_for_each_entry_continue'
325 - 'hlist_for_each_entry_continue_rcu'
326 - 'hlist_for_each_entry_continue_rcu_bh'
327 - 'hlist_for_each_entry_from'
328 - 'hlist_for_each_entry_from_rcu'
329 - 'hlist_for_each_entry_rcu'
330 - 'hlist_for_each_entry_rcu_bh'
331 - 'hlist_for_each_entry_rcu_notrace'
332 - 'hlist_for_each_entry_safe'
333 - 'hlist_for_each_entry_srcu'
334 - '__hlist_for_each_rcu'
335 - 'hlist_for_each_safe'
336 - 'hlist_nulls_for_each_entry'
337 - 'hlist_nulls_for_each_entry_from'
338 - 'hlist_nulls_for_each_entry_rcu'
339 - 'hlist_nulls_for_each_entry_safe'
340 - 'i3c_bus_for_each_i2cdev'
341 - 'i3c_bus_for_each_i3cdev'
342 - 'ide_host_for_each_port'
343 - 'ide_port_for_each_dev'
344 - 'ide_port_for_each_present_dev'
345 - 'idr_for_each_entry'
346 - 'idr_for_each_entry_continue'
347 - 'idr_for_each_entry_continue_ul'
348 - 'idr_for_each_entry_ul'
349 - 'in_dev_for_each_ifa_rcu'
350 - 'in_dev_for_each_ifa_rtnl'
351 - 'inet_bind_bucket_for_each'
352 - 'inet_lhash2_for_each_icsk_rcu'
354 - 'key_for_each_safe'
355 - 'klp_for_each_func'
356 - 'klp_for_each_func_safe'
357 - 'klp_for_each_func_static'
358 - 'klp_for_each_object'
359 - 'klp_for_each_object_safe'
360 - 'klp_for_each_object_static'
361 - 'kunit_suite_for_each_test_case'
362 - 'kvm_for_each_memslot'
363 - 'kvm_for_each_vcpu'
365 - 'list_for_each_codec'
366 - 'list_for_each_codec_safe'
367 - 'list_for_each_continue'
368 - 'list_for_each_entry'
369 - 'list_for_each_entry_continue'
370 - 'list_for_each_entry_continue_rcu'
371 - 'list_for_each_entry_continue_reverse'
372 - 'list_for_each_entry_from'
373 - 'list_for_each_entry_from_rcu'
374 - 'list_for_each_entry_from_reverse'
375 - 'list_for_each_entry_lockless'
376 - 'list_for_each_entry_rcu'
377 - 'list_for_each_entry_reverse'
378 - 'list_for_each_entry_safe'
379 - 'list_for_each_entry_safe_continue'
380 - 'list_for_each_entry_safe_from'
381 - 'list_for_each_entry_safe_reverse'
382 - 'list_for_each_entry_srcu'
383 - 'list_for_each_prev'
384 - 'list_for_each_prev_safe'
385 - 'list_for_each_safe'
387 - 'llist_for_each_entry'
388 - 'llist_for_each_entry_safe'
389 - 'llist_for_each_safe'
390 - 'mci_for_each_dimm'
391 - 'media_device_for_each_entity'
392 - 'media_device_for_each_intf'
393 - 'media_device_for_each_link'
394 - 'media_device_for_each_pad'
395 - 'nanddev_io_for_each_page'
396 - 'netdev_for_each_lower_dev'
397 - 'netdev_for_each_lower_private'
398 - 'netdev_for_each_lower_private_rcu'
399 - 'netdev_for_each_mc_addr'
400 - 'netdev_for_each_uc_addr'
401 - 'netdev_for_each_upper_dev_rcu'
402 - 'netdev_hw_addr_list_for_each'
403 - 'nft_rule_for_each_expr'
404 - 'nla_for_each_attr'
405 - 'nla_for_each_nested'
406 - 'nlmsg_for_each_attr'
407 - 'nlmsg_for_each_msg'
408 - 'nr_neigh_for_each'
409 - 'nr_neigh_for_each_safe'
411 - 'nr_node_for_each_safe'
412 - 'of_for_each_phandle'
413 - 'of_property_for_each_string'
414 - 'of_property_for_each_u32'
415 - 'pci_bus_for_each_resource'
416 - 'pcl_for_each_chunk'
417 - 'pcl_for_each_segment'
418 - 'pcm_for_each_format'
419 - 'ping_portaddr_for_each_entry'
421 - 'plist_for_each_continue'
422 - 'plist_for_each_entry'
423 - 'plist_for_each_entry_continue'
424 - 'plist_for_each_entry_safe'
425 - 'plist_for_each_safe'
426 - 'pnp_for_each_card'
428 - 'protocol_for_each_card'
429 - 'protocol_for_each_dev'
430 - 'queue_for_each_hw_ctx'
431 - 'radix_tree_for_each_slot'
432 - 'radix_tree_for_each_tagged'
433 - 'rbtree_postorder_for_each_entry_safe'
434 - 'rdma_for_each_block'
435 - 'rdma_for_each_port'
436 - 'rdma_umem_for_each_dma_block'
437 - 'resource_list_for_each_entry'
438 - 'resource_list_for_each_entry_safe'
439 - 'rhl_for_each_entry_rcu'
442 - 'rht_for_each_entry'
443 - 'rht_for_each_entry_from'
444 - 'rht_for_each_entry_rcu'
445 - 'rht_for_each_entry_rcu_from'
446 - 'rht_for_each_entry_safe'
447 - 'rht_for_each_from'
449 - 'rht_for_each_rcu_from'
450 - '__rq_for_each_bio'
452 - 'rq_for_each_segment'
453 - 'scsi_for_each_prot_sg'
455 - 'sctp_for_each_hentry'
456 - 'sctp_skb_for_each'
457 - 'shdma_for_each_chan'
458 - '__shost_for_each_device'
459 - 'shost_for_each_device'
461 - 'sk_for_each_bound'
462 - 'sk_for_each_entry_offset_rcu'
466 - 'sk_nulls_for_each'
467 - 'sk_nulls_for_each_from'
468 - 'sk_nulls_for_each_rcu'
469 - 'snd_array_for_each'
470 - 'snd_pcm_group_for_each_entry'
471 - 'snd_soc_dapm_widget_for_each_path'
472 - 'snd_soc_dapm_widget_for_each_path_safe'
473 - 'snd_soc_dapm_widget_for_each_sink_path'
474 - 'snd_soc_dapm_widget_for_each_source_path'
475 - 'tb_property_for_each'
476 - 'tcf_exts_for_each_action'
477 - 'udp_portaddr_for_each_entry'
478 - 'udp_portaddr_for_each_entry_rcu'
479 - 'usb_hub_for_each_child'
480 - 'v4l2_device_for_each_subdev'
481 - 'v4l2_m2m_for_each_dst_buf'
482 - 'v4l2_m2m_for_each_dst_buf_safe'
483 - 'v4l2_m2m_for_each_src_buf'
484 - 'v4l2_m2m_for_each_src_buf_safe'
485 - 'virtio_device_for_each_vq'
486 - 'while_for_each_ftrace_op'
488 - 'xa_for_each_marked'
489 - 'xa_for_each_range'
490 - 'xa_for_each_start'
492 - 'xas_for_each_conflict'
493 - 'xas_for_each_marked'
494 - 'xbc_array_for_each_value'
495 - 'xbc_for_each_key_value'
496 - 'xbc_node_for_each_array_value'
497 - 'xbc_node_for_each_child'
498 - 'xbc_node_for_each_key_value'
499 - 'zorro_for_each_dev'
501 #IncludeBlocks: Preserve # Unknown to clang-format-5.0
505 IncludeIsMainRegex: '(Test)?$'
506 IndentCaseLabels: false
507 #IndentPPDirectives: None # Unknown to clang-format-5.0
509 IndentWrappedFunctionNames: false
510 JavaScriptQuotes: Leave
511 JavaScriptWrapImports: true
512 KeepEmptyLinesAtTheStartOfBlocks: false
515 MaxEmptyLinesToKeep: 1
516 NamespaceIndentation: None
517 #ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
518 ObjCBlockIndentWidth: 8
519 ObjCSpaceAfterProperty: true
520 ObjCSpaceBeforeProtocolList: true
522 # Taken from git's rules
523 #PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
524 PenaltyBreakBeforeFirstCallParameter: 30
525 PenaltyBreakComment: 10
526 PenaltyBreakFirstLessLess: 0
527 PenaltyBreakString: 10
528 PenaltyExcessCharacter: 100
529 PenaltyReturnTypeOnItsOwnLine: 60
531 PointerAlignment: Right
532 ReflowComments: false
534 #SortUsingDeclarations: false # Unknown to clang-format-4.0
535 SpaceAfterCStyleCast: false
536 SpaceAfterTemplateKeyword: true
537 SpaceBeforeAssignmentOperators: true
538 #SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
539 #SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
540 SpaceBeforeParens: ControlStatements
541 #SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
542 SpaceInEmptyParentheses: false
543 SpacesBeforeTrailingComments: 1
544 SpacesInAngles: false
545 SpacesInContainerLiterals: false
546 SpacesInCStyleCastParentheses: false
547 SpacesInParentheses: false
548 SpacesInSquareBrackets: false