Skip to content

Commit

Permalink
s390/dis: use correct escape sequence for '%' character
Browse files Browse the repository at this point in the history
The double escape character sequence introduced with commit
272fa59 ("s390/dis: Fix handling of format specifiers") is not
necessary anymore since commit 561e103 ("s390/dis: Fix printing
of the register numbers").

Instead this now generates an extra '%' character:

lg      %%r1,160(%%r11)

So fix this and basically revert 272fa59.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Mar 2, 2016
1 parent 443a813 commit ee8479b
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions arch/s390/kernel/dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,23 +1920,16 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
}
if (separator)
ptr += sprintf(ptr, "%c", separator);
/*
* Use four '%' characters below because of the
* following two conversions:
*
* 1) sprintf: %%%%r -> %%r
* 2) printk : %%r -> %r
*/
if (operand->flags & OPERAND_GPR)
ptr += sprintf(ptr, "%%%%r%i", value);
ptr += sprintf(ptr, "%%r%i", value);
else if (operand->flags & OPERAND_FPR)
ptr += sprintf(ptr, "%%%%f%i", value);
ptr += sprintf(ptr, "%%f%i", value);
else if (operand->flags & OPERAND_AR)
ptr += sprintf(ptr, "%%%%a%i", value);
ptr += sprintf(ptr, "%%a%i", value);
else if (operand->flags & OPERAND_CR)
ptr += sprintf(ptr, "%%%%c%i", value);
ptr += sprintf(ptr, "%%c%i", value);
else if (operand->flags & OPERAND_VR)
ptr += sprintf(ptr, "%%%%v%i", value);
ptr += sprintf(ptr, "%%v%i", value);
else if (operand->flags & OPERAND_PCREL)
ptr += sprintf(ptr, "%lx", (signed int) value
+ addr);
Expand Down

0 comments on commit ee8479b

Please sign in to comment.