Blame SOURCES/0031-ndctl-add-.clang-format.patch

2eb93d
From dc712e47c39f4dbc5f089831fd50dd1a2752c8fc Mon Sep 17 00:00:00 2001
2eb93d
From: Vishal Verma <vishal.l.verma@intel.com>
2eb93d
Date: Thu, 7 Oct 2021 02:21:23 -0600
2eb93d
Subject: [PATCH 031/217] ndctl: add .clang-format
2eb93d
2eb93d
Copy the Linux kernel's .clang-format and modify it for ndctl. Only the
2eb93d
'ForEachMacros' section has been modified from the original kernel copy.
2eb93d
2eb93d
Cc: Dan Williams <dan.j.williams@intel.com>
2eb93d
Reported-by: Ben Widawsky <ben.widawsky@intel.com>
2eb93d
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
2eb93d
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
2eb93d
---
2eb93d
 .clang-format | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++
2eb93d
 1 file changed, 161 insertions(+)
2eb93d
 create mode 100644 .clang-format
2eb93d
2eb93d
diff --git a/.clang-format b/.clang-format
2eb93d
new file mode 100644
2eb93d
index 0000000..4e00fff
2eb93d
--- /dev/null
2eb93d
+++ b/.clang-format
2eb93d
@@ -0,0 +1,161 @@
2eb93d
+# SPDX-License-Identifier: GPL-2.0
2eb93d
+#
2eb93d
+# clang-format configuration file. Intended for clang-format >= 4.
2eb93d
+# Copied from Linux's .clang-format
2eb93d
+#
2eb93d
+# For more information, see:
2eb93d
+#
2eb93d
+#   https://clang.llvm.org/docs/ClangFormat.html
2eb93d
+#   https://clang.llvm.org/docs/ClangFormatStyleOptions.html
2eb93d
+#
2eb93d
+---
2eb93d
+AccessModifierOffset: -4
2eb93d
+AlignAfterOpenBracket: Align
2eb93d
+AlignConsecutiveAssignments: false
2eb93d
+AlignConsecutiveDeclarations: false
2eb93d
+#AlignEscapedNewlines: Left # Unknown to clang-format-4.0
2eb93d
+AlignOperands: true
2eb93d
+AlignTrailingComments: false
2eb93d
+AllowAllParametersOfDeclarationOnNextLine: false
2eb93d
+AllowShortBlocksOnASingleLine: false
2eb93d
+AllowShortCaseLabelsOnASingleLine: false
2eb93d
+AllowShortFunctionsOnASingleLine: None
2eb93d
+AllowShortIfStatementsOnASingleLine: false
2eb93d
+AllowShortLoopsOnASingleLine: false
2eb93d
+AlwaysBreakAfterDefinitionReturnType: None
2eb93d
+AlwaysBreakAfterReturnType: None
2eb93d
+AlwaysBreakBeforeMultilineStrings: false
2eb93d
+AlwaysBreakTemplateDeclarations: false
2eb93d
+BinPackArguments: true
2eb93d
+BinPackParameters: true
2eb93d
+BraceWrapping:
2eb93d
+  AfterClass: false
2eb93d
+  AfterControlStatement: false
2eb93d
+  AfterEnum: false
2eb93d
+  AfterFunction: true
2eb93d
+  AfterNamespace: true
2eb93d
+  AfterObjCDeclaration: false
2eb93d
+  AfterStruct: false
2eb93d
+  AfterUnion: false
2eb93d
+  #AfterExternBlock: false # Unknown to clang-format-5.0
2eb93d
+  BeforeCatch: false
2eb93d
+  BeforeElse: false
2eb93d
+  IndentBraces: false
2eb93d
+  #SplitEmptyFunction: true # Unknown to clang-format-4.0
2eb93d
+  #SplitEmptyRecord: true # Unknown to clang-format-4.0
2eb93d
+  #SplitEmptyNamespace: true # Unknown to clang-format-4.0
2eb93d
+BreakBeforeBinaryOperators: None
2eb93d
+BreakBeforeBraces: Custom
2eb93d
+#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
2eb93d
+BreakBeforeTernaryOperators: false
2eb93d
+BreakConstructorInitializersBeforeComma: false
2eb93d
+#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
2eb93d
+BreakAfterJavaFieldAnnotations: false
2eb93d
+BreakStringLiterals: false
2eb93d
+ColumnLimit: 80
2eb93d
+CommentPragmas: '^ IWYU pragma:'
2eb93d
+#CompactNamespaces: false # Unknown to clang-format-4.0
2eb93d
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
2eb93d
+ConstructorInitializerIndentWidth: 8
2eb93d
+ContinuationIndentWidth: 8
2eb93d
+Cpp11BracedListStyle: false
2eb93d
+DerivePointerAlignment: false
2eb93d
+DisableFormat: false
2eb93d
+ExperimentalAutoDetectBinPacking: false
2eb93d
+#FixNamespaceComments: false # Unknown to clang-format-4.0
2eb93d
+
2eb93d
+# Taken from:
2eb93d
+# while read -r sym; do
2eb93d
+# 	printf "  - '%s'\n" "$sym";
2eb93d
+# done < \
2eb93d
+# 	<(cscope -dL6 "foreach|for_each" \
2eb93d
+# 	| awk '{ print $4 $5 }' | grep -E 'foreach|for_each' \
2eb93d
+# 	| sed -e 's/#define//' \
2eb93d
+# 		-e 's/*//' \
2eb93d
+# 		-e 's/://' \
2eb93d
+# 		-e 's/\(.*for_each.*\)(.*/\1/' \
2eb93d
+# 		-e 's/\(.*foreach.*\)(.*/\1/' \
2eb93d
+# 	| sort -u)
2eb93d
+ForEachMacros:
2eb93d
+  - 'daxctl_dev_foreach'
2eb93d
+  - 'daxctl_mapping_foreach'
2eb93d
+  - 'daxctl_region_foreach'
2eb93d
+  - 'kmod_list_foreach'
2eb93d
+  - 'kmod_list_foreach_reverse'
2eb93d
+  - 'list_for_each'
2eb93d
+  - 'list_for_each_off'
2eb93d
+  - 'list_for_each_rev'
2eb93d
+  - 'list_for_each_safe'
2eb93d
+  - 'list_for_each_safe_off'
2eb93d
+  - 'ndctl_btt_foreach'
2eb93d
+  - 'ndctl_btt_foreach_safe'
2eb93d
+  - 'ndctl_bus_foreach'
2eb93d
+  - 'ndctl_dax_foreach'
2eb93d
+  - 'ndctl_dax_foreach_safe'
2eb93d
+  - 'ndctl_dimm_foreach'
2eb93d
+  - 'ndctl_dimm_foreach_in_interleave_set'
2eb93d
+  - 'ndctl_dimm_foreach_in_region'
2eb93d
+  - 'ndctl_interleave_set_foreach'
2eb93d
+  - 'ndctl_mapping_foreach'
2eb93d
+  - 'ndctl_namespace_badblock_foreach'
2eb93d
+  - 'ndctl_namespace_bb_foreach'
2eb93d
+  - 'ndctl_namespace_foreach'
2eb93d
+  - 'ndctl_namespace_foreach_safe'
2eb93d
+  - 'ndctl_pfn_foreach'
2eb93d
+  - 'ndctl_pfn_foreach_safe'
2eb93d
+  - 'ndctl_region_badblock_foreach'
2eb93d
+  - 'ndctl_region_foreach'
2eb93d
+  - 'udev_list_entry_foreach'
2eb93d
+
2eb93d
+#IncludeBlocks: Preserve # Unknown to clang-format-5.0
2eb93d
+IncludeCategories:
2eb93d
+  - Regex: '.*'
2eb93d
+    Priority: 1
2eb93d
+IncludeIsMainRegex: '(Test)?$'
2eb93d
+IndentCaseLabels: false
2eb93d
+#IndentPPDirectives: None # Unknown to clang-format-5.0
2eb93d
+IndentWidth: 8
2eb93d
+IndentWrappedFunctionNames: false
2eb93d
+JavaScriptQuotes: Leave
2eb93d
+JavaScriptWrapImports: true
2eb93d
+KeepEmptyLinesAtTheStartOfBlocks: false
2eb93d
+MacroBlockBegin: ''
2eb93d
+MacroBlockEnd: ''
2eb93d
+MaxEmptyLinesToKeep: 1
2eb93d
+NamespaceIndentation: None
2eb93d
+#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
2eb93d
+ObjCBlockIndentWidth: 8
2eb93d
+ObjCSpaceAfterProperty: true
2eb93d
+ObjCSpaceBeforeProtocolList: true
2eb93d
+
2eb93d
+# Taken from git's rules
2eb93d
+#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
2eb93d
+PenaltyBreakBeforeFirstCallParameter: 30
2eb93d
+PenaltyBreakComment: 10
2eb93d
+PenaltyBreakFirstLessLess: 0
2eb93d
+PenaltyBreakString: 10
2eb93d
+PenaltyExcessCharacter: 100
2eb93d
+PenaltyReturnTypeOnItsOwnLine: 60
2eb93d
+
2eb93d
+PointerAlignment: Right
2eb93d
+ReflowComments: false
2eb93d
+SortIncludes: false
2eb93d
+#SortUsingDeclarations: false # Unknown to clang-format-4.0
2eb93d
+SpaceAfterCStyleCast: false
2eb93d
+SpaceAfterTemplateKeyword: true
2eb93d
+SpaceBeforeAssignmentOperators: true
2eb93d
+#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
2eb93d
+#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
2eb93d
+SpaceBeforeParens: ControlStatements
2eb93d
+#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
2eb93d
+SpaceInEmptyParentheses: false
2eb93d
+SpacesBeforeTrailingComments: 1
2eb93d
+SpacesInAngles: false
2eb93d
+SpacesInContainerLiterals: false
2eb93d
+SpacesInCStyleCastParentheses: false
2eb93d
+SpacesInParentheses: false
2eb93d
+SpacesInSquareBrackets: false
2eb93d
+Standard: Cpp03
2eb93d
+TabWidth: 8
2eb93d
+UseTab: Always
2eb93d
+...
2eb93d
-- 
2eb93d
2.27.0
2eb93d