Skip to content

Commit

Permalink
tests/qtest/tdisp-test: fix warning
Browse files Browse the repository at this point in the history
/home/user/.work/qemu/tests/qtest/tdisp-test.c: In function ‘tdisp_testdev_send_message’:
/home/user/.work/qemu/tests/qtest/tdisp-test.c:214:30: error: ‘index’ may be used uninitialized [-Werror=maybe-uninitialized]
  214 |     for (size_t index; index < message_size / sizeof(uint32_t); ++index) {
      |                        ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/.work/qemu/tests/qtest/tdisp-test.c:214:17: note: ‘index’ was declared here
  214 |     for (size_t index; index < message_size / sizeof(uint32_t); ++index) {
      |                 ^~~~~
cc1: all warnings being treated as errors

Signed-off-by: Pierrick Bouvier <[email protected]>
  • Loading branch information
pbo-linaro committed Feb 13, 2025
1 parent 0c351ea commit 21521ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/qtest/tdisp-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static libspdm_return_t tdisp_testdev_send_message(
return LIBSPDM_STATUS_SEND_FAIL;
}

for (size_t index; index < message_size / sizeof(uint32_t); ++index) {
for (size_t index = 0; index < message_size / sizeof(uint32_t); ++index) {
qpcie_config_writel(&dev->dev, PCI_EXP_DOE + PCI_EXP_DOE_WR_DATA_MBOX,
data[index]);
}
Expand Down

0 comments on commit 21521ff

Please sign in to comment.