Commit 87824da
committed
ACPI: utils: Rearrange in acpi_evaluate_reference()
The code in acpi_evaluate_reference() can be improved in some ways
without changing its observable behavior. Among other things:
* None of the local variables in that function except for buffer
needs to be initialized.
* The element local variable is only used in the for () loop block,
so it can be defined there.
* Multiple checks can be combined.
* Code duplication related to error handling can be eliminated.
* Redundant inner parens can be dropped.
Modify the function as per the above.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>1 parent 3814876 commit 87824da
1 file changed
Lines changed: 24 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | 338 | | |
342 | | - | |
343 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
344 | 342 | | |
345 | 343 | | |
346 | 344 | | |
| |||
353 | 351 | | |
354 | 352 | | |
355 | 353 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
| 354 | + | |
| 355 | + | |
362 | 356 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 357 | + | |
370 | 358 | | |
371 | 359 | | |
372 | | - | |
| 360 | + | |
| 361 | + | |
373 | 362 | | |
374 | | - | |
375 | | - | |
| 363 | + | |
| 364 | + | |
376 | 365 | | |
377 | | - | |
378 | 366 | | |
379 | 367 | | |
380 | 368 | | |
381 | 369 | | |
382 | | - | |
383 | | - | |
| 370 | + | |
384 | 371 | | |
385 | 372 | | |
386 | 373 | | |
387 | | - | |
388 | | - | |
| 374 | + | |
389 | 375 | | |
390 | 376 | | |
391 | 377 | | |
392 | 378 | | |
393 | | - | |
394 | | - | |
| 379 | + | |
395 | 380 | | |
396 | 381 | | |
397 | 382 | | |
398 | 383 | | |
399 | 384 | | |
400 | 385 | | |
401 | 386 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | 387 | | |
409 | 388 | | |
410 | 389 | | |
411 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
412 | 402 | | |
413 | 403 | | |
414 | 404 | | |
| |||
0 commit comments