mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-23 18:51:32 -05:00
s390/disassembler: Use proper format specifiers for operand values
Treat register numbers as unsigned. Treat signed operand values as signed. This resolves multiple instances of the Cppcheck warning: warning: %i in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] Acked-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Jens Remus <jremus@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
committed by
Vasily Gorbik
parent
a84dd0d8ae
commit
73c81973b4
@@ -455,21 +455,21 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
|
||||
if (separator)
|
||||
ptr += sprintf(ptr, "%c", separator);
|
||||
if (operand->flags & OPERAND_GPR)
|
||||
ptr += sprintf(ptr, "%%r%i", value);
|
||||
ptr += sprintf(ptr, "%%r%u", value);
|
||||
else if (operand->flags & OPERAND_FPR)
|
||||
ptr += sprintf(ptr, "%%f%i", value);
|
||||
ptr += sprintf(ptr, "%%f%u", value);
|
||||
else if (operand->flags & OPERAND_AR)
|
||||
ptr += sprintf(ptr, "%%a%i", value);
|
||||
ptr += sprintf(ptr, "%%a%u", value);
|
||||
else if (operand->flags & OPERAND_CR)
|
||||
ptr += sprintf(ptr, "%%c%i", value);
|
||||
ptr += sprintf(ptr, "%%c%u", value);
|
||||
else if (operand->flags & OPERAND_VR)
|
||||
ptr += sprintf(ptr, "%%v%i", value);
|
||||
ptr += sprintf(ptr, "%%v%u", value);
|
||||
else if (operand->flags & OPERAND_PCREL) {
|
||||
void *pcrel = (void *)((int)value + addr);
|
||||
|
||||
ptr += sprintf(ptr, "%px", pcrel);
|
||||
} else if (operand->flags & OPERAND_SIGNED)
|
||||
ptr += sprintf(ptr, "%i", value);
|
||||
ptr += sprintf(ptr, "%i", (int)value);
|
||||
else
|
||||
ptr += sprintf(ptr, "%u", value);
|
||||
if (operand->flags & OPERAND_DISP)
|
||||
|
||||
Reference in New Issue
Block a user