clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ic5b4c8584fafe5ebe3d01c1f685cab271dd9690b
diff --git a/.clang-format b/.clang-format
index 38daa66..6da79a0 100644
--- a/.clang-format
+++ b/.clang-format
@@ -8,8 +8,10 @@
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
#AlignEscapedNewlines: Left # Unknown to clang-format-4.0
-AlignOperands: true
-AlignTrailingComments: false
+AlignOperands: Align
+AlignTrailingComments:
+ Kind: Always
+ OverEmptyLines: 1
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
@@ -38,6 +40,7 @@
#SplitEmptyFunction: true # Unknown to clang-format-4.0
#SplitEmptyRecord: true # Unknown to clang-format-4.0
#SplitEmptyNamespace: true # Unknown to clang-format-4.0
+BreakAfterAttributes: Never
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
@@ -53,6 +56,7 @@
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
+DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
@@ -66,9 +70,11 @@
#IndentPPDirectives: None # Unknown to clang-format-5.0
IndentWidth: 8
IndentWrappedFunctionNames: false
+InsertNewlineAtEOF: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
+LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
@@ -79,7 +85,7 @@
ObjCSpaceBeforeProtocolList: true
# Taken from git's rules
-#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
+PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
diff --git a/astlpc.c b/astlpc.c
index 6842ae1..5d51d64 100644
--- a/astlpc.c
+++ b/astlpc.c
@@ -942,10 +942,10 @@
mctp_astlpc_lpc_read(astlpc, &hdr, 0, sizeof(hdr));
/* Version negotiation */
- negotiated =
- mctp_astlpc_negotiate_version(ASTLPC_VER_MIN, ASTLPC_VER_CUR,
- be16toh(hdr.host_ver_min),
- be16toh(hdr.host_ver_cur));
+ negotiated = mctp_astlpc_negotiate_version(ASTLPC_VER_MIN,
+ ASTLPC_VER_CUR,
+ be16toh(hdr.host_ver_min),
+ be16toh(hdr.host_ver_cur));
/* MTU negotiation requires knowing which protocol we'll use */
assert(negotiated < ARRAY_SIZE(astlpc_protocol_version));
diff --git a/core.c b/core.c
index fcc9279..741082d 100644
--- a/core.c
+++ b/core.c
@@ -563,8 +563,8 @@
flags = hdr->flags_seq_tag & (MCTP_HDR_FLAG_SOM | MCTP_HDR_FLAG_EOM);
tag = (hdr->flags_seq_tag >> MCTP_HDR_TAG_SHIFT) & MCTP_HDR_TAG_MASK;
seq = (hdr->flags_seq_tag >> MCTP_HDR_SEQ_SHIFT) & MCTP_HDR_SEQ_MASK;
- tag_owner =
- (hdr->flags_seq_tag >> MCTP_HDR_TO_SHIFT) & MCTP_HDR_TO_MASK;
+ tag_owner = (hdr->flags_seq_tag >> MCTP_HDR_TO_SHIFT) &
+ MCTP_HDR_TO_MASK;
switch (flags) {
case MCTP_HDR_FLAG_SOM | MCTP_HDR_FLAG_EOM:
diff --git a/tests/test_astlpc.c b/tests/test_astlpc.c
index 91f6507..e8f2bce 100644
--- a/tests/test_astlpc.c
+++ b/tests/test_astlpc.c
@@ -982,9 +982,9 @@
host.mmio.bmc = false;
/* Set the MTU to 0 to provoke a failure */
- host.astlpc =
- mctp_astlpc_init(MCTP_BINDING_ASTLPC_MODE_HOST, 0, lpc_mem,
- &astlpc_direct_mmio_ops, &host.mmio);
+ host.astlpc = mctp_astlpc_init(MCTP_BINDING_ASTLPC_MODE_HOST, 0,
+ lpc_mem, &astlpc_direct_mmio_ops,
+ &host.mmio);
rc = mctp_register_bus(host.mctp, &host.astlpc->binding, 8);
assert(rc < 0);