]> git.pld-linux.org Git - packages/xen.git/blob - fix-misleading-indentation.patch
- up to 4.6.5
[packages/xen.git] / fix-misleading-indentation.patch
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.
5
6 gcc-6 adds -Wmisleading-indentation which found these issues.
7
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;
11                   ^~~~~~~~
12
13 xenalyze.c:2135:9: note: ...this 'if' clause, but it is not
14          if(J_weight<K_weight)
15          ^~
16
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;
19                   ^~~~~~~~
20
21 xenalyze.c:2137:9: note: ...this 'if' clause, but it is not
22          if(K_weight<I_weight)
23          ^~
24
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;
28                   ^~~~~~~~
29
30 xenalyze.c:2214:9: note: ...this 'if' clause, but it is not
31          if(J_weight<K_weight)
32          ^~
33
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;
36                   ^~~~~~~~
37
38 xenalyze.c:2216:9: note: ...this 'if' clause, but it is not
39          if(K_weight<I_weight)
40          ^~
41
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.
44
45 I have only build tested the result.
46
47 Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
48 Reviewed-by: George Dunlap <george.dunlap@citrix.com>
49 ---
50  tools/xentrace/xenalyze.c | 24 ++++++++++++++++--------
51  1 file changed, 16 insertions(+), 8 deletions(-)
52
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 */
59  
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) {
66 +            L=I;
67 +            L_weight = I_weight;
68 +        }
69 +        if(K_weight<I_weight) {
70 +            R=J;
71 +            R_weight = J_weight;
72 +        }
73      }
74  
75      return A[L];
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 */
78  
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) {
85 +            L=I;
86 +            L_weight = I_weight;
87 +        }
88 +        if(K_weight<I_weight) {
89 +            R=J;
90 +            R_weight = J_weight;
91 +        }
92      }
93  
94      return A[L];
95 -- 
96 2.1.4
97
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
102 MIME-Version: 1.0
103 Content-Type: text/plain; charset=utf8
104 Content-Transfer-Encoding: 8bit
105
106 Gcc6 build reports misleading indentation as warnings. Fix a few
107 warnings in stubdom.
108
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>
113 ---
114  stubdom/vtpmmgr/disk_read.c | 8 ++++----
115  stubdom/vtpmmgr/log.c       | 2 +-
116  2 files changed, 5 insertions(+), 5 deletions(-)
117
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;
124  
125      /*TPM 2.0 unbind | TPM 1.x unseal*/
126 -    if (hw_is_tpm2())
127 -        rc = TPM2_disk_unbind(&sealed, &olen, src);
128 -    else
129 -        rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
130 +       if (hw_is_tpm2())
131 +               rc = TPM2_disk_unbind(&sealed, &olen, src);
132 +       else
133 +               rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
134  
135         if (rc)
136                 return rc;
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;
144  
145 -    return("Unknown Error Code");
146 +  return("Unknown Error Code");
147  }
148 -- 
149 2.1.4
150
This page took 0.328526 seconds and 3 git commands to generate.