Repository navigation
Commit adb8049
tools/power x86_energy_perf_policy: Fix "uninitialized variable" warnings at -O2
x86_energy_perf_policy first uses __get_cpuid() to check the maximum
CPUID level and exits if it is too low. It then assumes that later
calls will succeed (which I think is architecturally guaranteed). It
also assumes that CPUID works at all (which is not guaranteed on
x86_32).
If optimisations are enabled, gcc warns about potentially
uninitialized variables. Fix this by adding an exit-on-error after
every call to __get_cpuid() instead of just checking the maximum
level.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Len Brown <len.brown@intel.com>1 parent a55aa89 commit adb8049
1 file changed
Lines changed: 15 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1262 | 1271 | | |
1263 | 1272 | | |
1264 | 1273 | | |
1265 | 1274 | | |
1266 | 1275 | | |
1267 | 1276 | | |
1268 | 1277 | | |
1269 | | - | |
| 1278 | + | |
1270 | 1279 | | |
1271 | 1280 | | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
| 1281 | + | |
1278 | 1282 | | |
1279 | 1283 | | |
1280 | 1284 | | |
| |||
1288 | 1292 | | |
1289 | 1293 | | |
1290 | 1294 | | |
1291 | | - | |
| 1295 | + | |
1292 | 1296 | | |
1293 | 1297 | | |
1294 | 1298 | | |
| |||
1306 | 1310 | | |
1307 | 1311 | | |
1308 | 1312 | | |
1309 | | - | |
| 1313 | + | |
1310 | 1314 | | |
1311 | 1315 | | |
1312 | 1316 | | |
| |||
1315 | 1319 | | |
1316 | 1320 | | |
1317 | 1321 | | |
1318 | | - | |
| 1322 | + | |
1319 | 1323 | | |
1320 | 1324 | | |
1321 | 1325 | | |
| |||
1340 | 1344 | | |
1341 | 1345 | | |
1342 | 1346 | | |
1343 | | - | |
| 1347 | + | |
1344 | 1348 | | |
1345 | 1349 | | |
1346 | 1350 | | |
| |||
0 commit comments