1 From ebdba150bff1d914805d60efa576337bbef0c305 Mon Sep 17 00:00:00 2001
2 From: Ian Campbell <ian.campbell@citrix.com>
3 Date: Fri, 22 Jan 2016 14:27:28 +0000
4 Subject: [PATCH] xenalyze: fix misleading indentation.
6 gcc-6 adds -Wmisleading-indentation which found these issues.
8 xenalyze.c: In function 'weighted_percentile':
9 xenalyze.c:2136:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
10 L=I; L_weight = I_weight;
13 xenalyze.c:2135:9: note: ...this 'if' clause, but it is not
17 xenalyze.c:2138:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
18 R=J; R_weight = J_weight;
21 xenalyze.c:2137:9: note: ...this 'if' clause, but it is not
25 xenalyze.c: In function 'self_weighted_percentile':
26 xenalyze.c:2215:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
27 L=I; L_weight = I_weight;
30 xenalyze.c:2214:9: note: ...this 'if' clause, but it is not
34 xenalyze.c:2217:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
35 R=J; R_weight = J_weight;
38 xenalyze.c:2216:9: note: ...this 'if' clause, but it is not
42 I've modified according to what I think the intention is, i.e. added braces
43 rather than moving the line in question out a level.
45 I have only build tested the result.
47 Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
48 Reviewed-by: George Dunlap <george.dunlap@citrix.com>
50 tools/xentrace/xenalyze.c | 24 ++++++++++++++++--------
51 1 file changed, 16 insertions(+), 8 deletions(-)
53 diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
54 index 5a2735c..4bcaf83 100644
55 --- a/tools/xentrace/xenalyze.c
56 +++ b/tools/xentrace/xenalyze.c
57 @@ -2132,10 +2132,14 @@ float weighted_percentile(float * A, /* values */
58 } while (I <= J); /* Keep going until our pointers meet or pass */
60 /* Re-adjust L and R, based on which element we're looking for */
61 - if(J_weight<K_weight)
62 - L=I; L_weight = I_weight;
63 - if(K_weight<I_weight)
64 - R=J; R_weight = J_weight;
65 + if(J_weight<K_weight) {
67 + L_weight = I_weight;
69 + if(K_weight<I_weight) {
71 + R_weight = J_weight;
76 @@ -2211,10 +2215,14 @@ long long self_weighted_percentile(long long * A,
77 } while (I <= J); /* Keep going until our pointers meet or pass */
79 /* Re-adjust L and R, based on which element we're looking for */
80 - if(J_weight<K_weight)
81 - L=I; L_weight = I_weight;
82 - if(K_weight<I_weight)
83 - R=J; R_weight = J_weight;
84 + if(J_weight<K_weight) {
86 + L_weight = I_weight;
88 + if(K_weight<I_weight) {
90 + R_weight = J_weight;
98 From 9fdffbbab3ada427bac07076f042f0265e5ae05f Mon Sep 17 00:00:00 2001
99 From: =?utf8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
100 Date: Thu, 10 Nov 2016 10:23:31 +0100
101 Subject: [PATCH] Fix misleading indentation warnings
103 Content-Type: text/plain; charset=utf8
104 Content-Transfer-Encoding: 8bit
106 Gcc6 build reports misleading indentation as warnings. Fix a few
109 Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
110 Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
111 Acked-by: Quan Xu <xuquan8@huawei.com>
112 Release-acked-by: Wei Liu <wei.liu2@citrix.com>
114 stubdom/vtpmmgr/disk_read.c | 8 ++++----
115 stubdom/vtpmmgr/log.c | 2 +-
116 2 files changed, 5 insertions(+), 5 deletions(-)
118 diff --git a/stubdom/vtpmmgr/disk_read.c b/stubdom/vtpmmgr/disk_read.c
119 index 944d3ff..48cfbfe 100644
120 --- a/stubdom/vtpmmgr/disk_read.c
121 +++ b/stubdom/vtpmmgr/disk_read.c
122 @@ -123,10 +123,10 @@ static int parse_root_key(struct mem_tpm_mgr *dst, struct disk_seal_entry *src)
123 struct disk_root_sealed_data sealed;
125 /*TPM 2.0 unbind | TPM 1.x unseal*/
127 - rc = TPM2_disk_unbind(&sealed, &olen, src);
129 - rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
131 + rc = TPM2_disk_unbind(&sealed, &olen, src);
133 + rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
137 diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
138 index a82c913..c1bc8f3 100644
139 --- a/stubdom/vtpmmgr/log.c
140 +++ b/stubdom/vtpmmgr/log.c
141 @@ -147,5 +147,5 @@ const char* tpm_get_error_name (TPM_RESULT code) {
142 if (code == error_msgs[i].code)
143 return error_msgs[i].code_name;
145 - return("Unknown Error Code");
146 + return("Unknown Error Code");