The patch titled mips: use the common ascii hex helpers has been added to the -mm tree. Its filename is mips-use-the-common-ascii-hex-helpers.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: mips: use the common ascii hex helpers From: Harvey Harrison <harvey.harrison@xxxxxxxxx> Signed-off-by: Harvey Harrison <harvey.harrison@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/mips/kernel/gdb-stub.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff -puN arch/mips/kernel/gdb-stub.c~mips-use-the-common-ascii-hex-helpers arch/mips/kernel/gdb-stub.c --- a/arch/mips/kernel/gdb-stub.c~mips-use-the-common-ascii-hex-helpers +++ a/arch/mips/kernel/gdb-stub.c @@ -190,7 +190,6 @@ static char input_buffer[BUFMAX]; static char output_buffer[BUFMAX]; static int initialized; /* !0 means we've been initialized */ static int kgdb_started; -static const char hexchars[]="0123456789abcdef"; /* Used to prevent crashes in memory access. Note that they'll crash anyway if we haven't set up fault handlers yet... */ @@ -306,8 +305,8 @@ static void putpacket(char *buffer) } putDebugChar('#'); - putDebugChar(hexchars[checksum >> 4]); - putDebugChar(hexchars[checksum & 0xf]); + putDebugChar(hex_asc_hi(checksum)); + putDebugChar(hex_asc_lo(checksum)); } while ((getDebugChar() & 0x7f) != '+'); @@ -328,8 +327,7 @@ static unsigned char *mem2hex(char *mem, while (count-- > 0) { if (kgdb_read_byte(mem++, &ch) != 0) return 0; - *buf++ = hexchars[ch >> 4]; - *buf++ = hexchars[ch & 0xf]; + buf = pack_hex_byte(buf, ch); } *buf = 0; @@ -812,14 +810,12 @@ void handle_exception(struct gdb_regs *r * Send trap type (converted to signal) */ *ptr++ = 'T'; - *ptr++ = hexchars[sigval >> 4]; - *ptr++ = hexchars[sigval & 0xf]; + ptr = pack_hex_byte(ptr, sigval); /* * Send Error PC */ - *ptr++ = hexchars[REG_EPC >> 4]; - *ptr++ = hexchars[REG_EPC & 0xf]; + ptr = pack_hex_byte(ptr, REG_EPC); *ptr++ = ':'; ptr = mem2hex((char *)®s->cp0_epc, ptr, sizeof(long), 0); *ptr++ = ';'; @@ -827,8 +823,7 @@ void handle_exception(struct gdb_regs *r /* * Send frame pointer */ - *ptr++ = hexchars[REG_FP >> 4]; - *ptr++ = hexchars[REG_FP & 0xf]; + ptr = pack_hex_byte(ptr, REG_FP); *ptr++ = ':'; ptr = mem2hex((char *)®s->reg30, ptr, sizeof(long), 0); *ptr++ = ';'; @@ -836,8 +831,7 @@ void handle_exception(struct gdb_regs *r /* * Send stack pointer */ - *ptr++ = hexchars[REG_SP >> 4]; - *ptr++ = hexchars[REG_SP & 0xf]; + ptr = pack_hex_byte(ptr, REG_SP); *ptr++ = ':'; ptr = mem2hex((char *)®s->reg29, ptr, sizeof(long), 0); *ptr++ = ';'; @@ -856,8 +850,8 @@ void handle_exception(struct gdb_regs *r { case '?': output_buffer[0] = 'S'; - output_buffer[1] = hexchars[sigval >> 4]; - output_buffer[2] = hexchars[sigval & 0xf]; + output_buffer[1] = hex_asc_hi(sigval); + output_buffer[2] = hex_asc_lo(sigval); output_buffer[3] = 0; break; _ Patches currently in -mm which might be from harvey.harrison@xxxxxxxxx are mmc-make-one-bit-signed-bitfields-unsigned.patch linux-next.patch kgdb-use-put_unaligned_be32-helper.patch cifs-remove-global_extern-macro.patch media-use-get_unaligned_-helpers.patch hid-use-get-put_unaligned_-helpers.patch git-input.patch ata-remove-fit-macro.patch nfs-replace-remaining-__function__-occurrences.patch parisc-replace-remaining-__function__-occurences.patch drivers-parisc-replace-remaining-__function__-occurrences.patch scsi-replace-remaining-__function__-occurrences.patch fusion-replace-remaining-__function__-occurrences.patch scsi-replace-__inline-with-inline.patch scsi-use-get_unaligned_-helpers.patch scsi-aic79xx_core-fix-shadowed-variables-add-statics.patch scsi-aic79xx-aic79xx_pcic-fix-shadowed-variables.patch block-use-get_unaligned_-helpers.patch git-watchdog.patch mac80211-michaelc-use-kernel-provided-infrastructure.patch mac80211-introduce-struct-michael_mic_ctx-and-static-helpers.patch mac80211-tkipc-use-kernel-provided-infrastructure.patch mac80211-add-const-remove-unused-function-make-one-function-static.patch mac80211-add-a-struct-to-hold-tkip-context.patch mac80211-tkipc-use-struct-tkip_ctx-in-phase-1-key-mixing.patch mac80211-tkipc-use-struct-tkip_ctx-in-phase-2-key-mixing.patch b43-replace-limit_value-macro-with-clamp_val.patch b43legacy-replace-limit_value-macro-with-clamp_val.patch wireless-use-get-put_unaligned_-helpers.patch xfs-use-get_unaligned_-helpers.patch xtensa-replace-remaining-__function__-occurences.patch lib-create-common-ascii-hex-array.patch fs-ldm-use-get_unaligned_-helpers.patch include-use-get-put_unaligned_-helpers.patch lzo-use-get-put_unaligned_-helpers.patch video-fix-integer-as-null-pointer-warnings.patch scsi-use-the-common-hex_asc-array-rather-than-a-private-one.patch isdn-use-the-common-ascii-hex-helpers.patch net-use-the-common-ascii-hex-helpers.patch kgdb-use-the-common-ascii-hex-helpers.patch cris-use-the-common-ascii-hex-helpers.patch frv-use-the-common-ascii-hex-helpers.patch mn10300-use-the-common-ascii-hex-helpers.patch mips-use-the-common-ascii-hex-helpers.patch sh-use-the-common-ascii-hex-helpers.patch ppc-use-the-common-ascii-hex-helpers.patch aacraid-linitc-make-aac_show_serial_number-static.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html