diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2017-06-19 11:46:45 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-06-20 13:57:03 +0100 |
commit | 20f26e0cd5917344e3182411e353f4bb827b7ef8 (patch) | |
tree | 3322341477356b34d659d15df53a4c35eee24933 /reginfo.c | |
parent | 5b60c9f45cd99b5de88727db984912a75f331ccf (diff) |
all: fix up code consistency
This is pretty much a mechanical change where I ran:
indent -kr
Across all the files and then fixed up all but a few violations of:
../../qemu.git/scripts/checkpatch.pl -f *.c *.h > checkpatch.out
Along with heavy use of M-x untabify to make everything consistent.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20170619104655.31104-4-alex.bennee@linaro.org
[PMM: some bits of indent in risu_reginfo_arm.c were not right: fixed]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'reginfo.c')
-rw-r--r-- | reginfo.c | 114 |
1 files changed, 58 insertions, 56 deletions
@@ -18,8 +18,8 @@ struct reginfo master_ri, apprentice_ri; uint8_t apprentice_memblock[MEMBLOCKLEN]; -static int mem_used = 0; -static int packet_mismatch = 0; +static int mem_used; +static int packet_mismatch; int send_register_info(int sock, void *uc) { @@ -37,11 +37,12 @@ int send_register_info(int sock, void *uc) */ return send_data_pkt(sock, &ri, sizeof(ri)); case OP_SETMEMBLOCK: - memblock = (void *)(uintptr_t)get_reginfo_paramreg(&ri); - break; + memblock = (void *) (uintptr_t) get_reginfo_paramreg(&ri); + break; case OP_GETMEMBLOCK: set_ucontext_paramreg(uc, - get_reginfo_paramreg(&ri) + (uintptr_t)memblock); + get_reginfo_paramreg(&ri) + + (uintptr_t) memblock); break; case OP_COMPAREMEM: return send_data_pkt(sock, memblock, MEMBLOCKLEN); @@ -85,25 +86,25 @@ int recv_and_compare_register_info(int sock, void *uc) } send_response_byte(sock, resp); break; - case OP_SETMEMBLOCK: - memblock = (void *)(uintptr_t)get_reginfo_paramreg(&master_ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + - (uintptr_t)memblock); - break; - case OP_COMPAREMEM: - mem_used = 1; - if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) { - packet_mismatch = 1; - resp = 2; - } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != 0) { - /* memory mismatch */ - resp = 2; - } - send_response_byte(sock, resp); - break; - } + case OP_SETMEMBLOCK: + memblock = (void *) (uintptr_t) get_reginfo_paramreg(&master_ri); + break; + case OP_GETMEMBLOCK: + set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + + (uintptr_t) memblock); + break; + case OP_COMPAREMEM: + mem_used = 1; + if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) { + packet_mismatch = 1; + resp = 2; + } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != 0) { + /* memory mismatch */ + resp = 2; + } + send_response_byte(sock, resp); + break; + } return resp; } @@ -116,36 +117,37 @@ int recv_and_compare_register_info(int sock, void *uc) */ int report_match_status(void) { - int resp = 0; - fprintf(stderr, "match status...\n"); - if (packet_mismatch) { - fprintf(stderr, "packet mismatch (probably disagreement " - "about UNDEF on load/store)\n"); - /* We don't have valid reginfo from the apprentice side - * so stop now rather than printing anything about it. - */ - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - return 1; - } - if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { - fprintf(stderr, "mismatch on regs!\n"); - resp = 1; - } - if (mem_used && memcmp(memblock, &apprentice_memblock, MEMBLOCKLEN) != 0) { - fprintf(stderr, "mismatch on memory!\n"); - resp = 1; - } - if (!resp) { - fprintf(stderr, "match!\n"); - return 0; - } - - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - fprintf(stderr, "apprentice reginfo:\n"); - reginfo_dump(&apprentice_ri, stderr); - - reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); - return resp; + int resp = 0; + fprintf(stderr, "match status...\n"); + if (packet_mismatch) { + fprintf(stderr, "packet mismatch (probably disagreement " + "about UNDEF on load/store)\n"); + /* We don't have valid reginfo from the apprentice side + * so stop now rather than printing anything about it. + */ + fprintf(stderr, "master reginfo:\n"); + reginfo_dump(&master_ri, stderr); + return 1; + } + if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { + fprintf(stderr, "mismatch on regs!\n"); + resp = 1; + } + if (mem_used + && memcmp(memblock, &apprentice_memblock, MEMBLOCKLEN) != 0) { + fprintf(stderr, "mismatch on memory!\n"); + resp = 1; + } + if (!resp) { + fprintf(stderr, "match!\n"); + return 0; + } + + fprintf(stderr, "master reginfo:\n"); + reginfo_dump(&master_ri, stderr); + fprintf(stderr, "apprentice reginfo:\n"); + reginfo_dump(&apprentice_ri, stderr); + + reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); + return resp; } |