Skip to content

Commit 50e1499

Browse files
andy-shevtorvalds
authored andcommitted
kgdb: follow rename pack_hex_byte() to hex_byte_pack()
There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Cc: David Howells <dhowells@redhat.com> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Cc: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 55036ba commit 50e1499

5 files changed

Lines changed: 64 additions & 64 deletions

File tree

arch/cris/arch-v10/kernel/kgdb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ mem2hex(char *buf, unsigned char *mem, int count)
694694
/* Valid mem address. */
695695
for (i = 0; i < count; i++) {
696696
ch = *mem++;
697-
buf = pack_hex_byte(buf, ch);
697+
buf = hex_byte_pack(buf, ch);
698698
}
699699
}
700700

@@ -868,7 +868,7 @@ stub_is_stopped(int sigval)
868868
/* Send trap type (converted to signal) */
869869

870870
*ptr++ = 'T';
871-
ptr = pack_hex_byte(ptr, sigval);
871+
ptr = hex_byte_pack(ptr, sigval);
872872

873873
/* Send register contents. We probably only need to send the
874874
* PC, frame pointer and stack pointer here. Other registers will be
@@ -881,7 +881,7 @@ stub_is_stopped(int sigval)
881881
status = read_register (regno, &reg_cont);
882882

883883
if (status == SUCCESS) {
884-
ptr = pack_hex_byte(ptr, regno);
884+
ptr = hex_byte_pack(ptr, regno);
885885
*ptr++ = ':';
886886

887887
ptr = mem2hex(ptr, (unsigned char *)&reg_cont,

arch/cris/arch-v32/kernel/kgdb.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ mem2hex(char *buf, unsigned char *mem, int count)
677677
/* Valid mem address. */
678678
for (i = 0; i < count; i++) {
679679
ch = *mem++;
680-
buf = pack_hex_byte(buf, ch);
680+
buf = hex_byte_pack(buf, ch);
681681
}
682682
}
683683
/* Terminate properly. */
@@ -695,7 +695,7 @@ mem2hex_nbo(char *buf, unsigned char *mem, int count)
695695
mem += count - 1;
696696
for (i = 0; i < count; i++) {
697697
ch = *mem--;
698-
buf = pack_hex_byte(buf, ch);
698+
buf = hex_byte_pack(buf, ch);
699699
}
700700

701701
/* Terminate properly. */
@@ -880,7 +880,7 @@ stub_is_stopped(int sigval)
880880
/* Send trap type (converted to signal) */
881881

882882
*ptr++ = 'T';
883-
ptr = pack_hex_byte(ptr, sigval);
883+
ptr = hex_byte_pack(ptr, sigval);
884884

885885
if (((reg.exs & 0xff00) >> 8) == 0xc) {
886886

@@ -988,26 +988,26 @@ stub_is_stopped(int sigval)
988988
}
989989
/* Only send PC, frame and stack pointer. */
990990
read_register(PC, &reg_cont);
991-
ptr = pack_hex_byte(ptr, PC);
991+
ptr = hex_byte_pack(ptr, PC);
992992
*ptr++ = ':';
993993
ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[PC]);
994994
*ptr++ = ';';
995995

996996
read_register(R8, &reg_cont);
997-
ptr = pack_hex_byte(ptr, R8);
997+
ptr = hex_byte_pack(ptr, R8);
998998
*ptr++ = ':';
999999
ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[R8]);
10001000
*ptr++ = ';';
10011001

10021002
read_register(SP, &reg_cont);
1003-
ptr = pack_hex_byte(ptr, SP);
1003+
ptr = hex_byte_pack(ptr, SP);
10041004
*ptr++ = ':';
10051005
ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[SP]);
10061006
*ptr++ = ';';
10071007

10081008
/* Send ERP as well; this will save us an entire register fetch in some cases. */
10091009
read_register(ERP, &reg_cont);
1010-
ptr = pack_hex_byte(ptr, ERP);
1010+
ptr = hex_byte_pack(ptr, ERP);
10111011
*ptr++ = ':';
10121012
ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[ERP]);
10131013
*ptr++ = ';';

arch/frv/kernel/gdb-stub.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -672,44 +672,44 @@ static unsigned char *mem2hex(const void *_mem, char *buf, int count, int may_fa
672672
if ((uint32_t)mem&1 && count>=1) {
673673
if (!gdbstub_read_byte(mem,ch))
674674
return NULL;
675-
buf = pack_hex_byte(buf, ch[0]);
675+
buf = hex_byte_pack(buf, ch[0]);
676676
mem++;
677677
count--;
678678
}
679679

680680
if ((uint32_t)mem&3 && count>=2) {
681681
if (!gdbstub_read_word(mem,(uint16_t *)ch))
682682
return NULL;
683-
buf = pack_hex_byte(buf, ch[0]);
684-
buf = pack_hex_byte(buf, ch[1]);
683+
buf = hex_byte_pack(buf, ch[0]);
684+
buf = hex_byte_pack(buf, ch[1]);
685685
mem += 2;
686686
count -= 2;
687687
}
688688

689689
while (count>=4) {
690690
if (!gdbstub_read_dword(mem,(uint32_t *)ch))
691691
return NULL;
692-
buf = pack_hex_byte(buf, ch[0]);
693-
buf = pack_hex_byte(buf, ch[1]);
694-
buf = pack_hex_byte(buf, ch[2]);
695-
buf = pack_hex_byte(buf, ch[3]);
692+
buf = hex_byte_pack(buf, ch[0]);
693+
buf = hex_byte_pack(buf, ch[1]);
694+
buf = hex_byte_pack(buf, ch[2]);
695+
buf = hex_byte_pack(buf, ch[3]);
696696
mem += 4;
697697
count -= 4;
698698
}
699699

700700
if (count>=2) {
701701
if (!gdbstub_read_word(mem,(uint16_t *)ch))
702702
return NULL;
703-
buf = pack_hex_byte(buf, ch[0]);
704-
buf = pack_hex_byte(buf, ch[1]);
703+
buf = hex_byte_pack(buf, ch[0]);
704+
buf = hex_byte_pack(buf, ch[1]);
705705
mem += 2;
706706
count -= 2;
707707
}
708708

709709
if (count>=1) {
710710
if (!gdbstub_read_byte(mem,ch))
711711
return NULL;
712-
buf = pack_hex_byte(buf, ch[0]);
712+
buf = hex_byte_pack(buf, ch[0]);
713713
}
714714

715715
*buf = 0;
@@ -1498,21 +1498,21 @@ void gdbstub(int sigval)
14981498
ptr = mem2hex(title, ptr, sizeof(title) - 1,0);
14991499

15001500
hx = hex_asc_hi(brr >> 24);
1501-
ptr = pack_hex_byte(ptr, hx);
1501+
ptr = hex_byte_pack(ptr, hx);
15021502
hx = hex_asc_lo(brr >> 24);
1503-
ptr = pack_hex_byte(ptr, hx);
1503+
ptr = hex_byte_pack(ptr, hx);
15041504
hx = hex_asc_hi(brr >> 16);
1505-
ptr = pack_hex_byte(ptr, hx);
1505+
ptr = hex_byte_pack(ptr, hx);
15061506
hx = hex_asc_lo(brr >> 16);
1507-
ptr = pack_hex_byte(ptr, hx);
1507+
ptr = hex_byte_pack(ptr, hx);
15081508
hx = hex_asc_hi(brr >> 8);
1509-
ptr = pack_hex_byte(ptr, hx);
1509+
ptr = hex_byte_pack(ptr, hx);
15101510
hx = hex_asc_lo(brr >> 8);
1511-
ptr = pack_hex_byte(ptr, hx);
1511+
ptr = hex_byte_pack(ptr, hx);
15121512
hx = hex_asc_hi(brr);
1513-
ptr = pack_hex_byte(ptr, hx);
1513+
ptr = hex_byte_pack(ptr, hx);
15141514
hx = hex_asc_lo(brr);
1515-
ptr = pack_hex_byte(ptr, hx);
1515+
ptr = hex_byte_pack(ptr, hx);
15161516

15171517
ptr = mem2hex(crlf, ptr, sizeof(crlf) - 1, 0);
15181518
*ptr = 0;
@@ -1526,26 +1526,26 @@ void gdbstub(int sigval)
15261526

15271527
/* Send trap type (converted to signal) */
15281528
*ptr++ = 'T';
1529-
ptr = pack_hex_byte(ptr, sigval);
1529+
ptr = hex_byte_pack(ptr, sigval);
15301530

15311531
/* Send Error PC */
1532-
ptr = pack_hex_byte(ptr, GDB_REG_PC);
1532+
ptr = hex_byte_pack(ptr, GDB_REG_PC);
15331533
*ptr++ = ':';
15341534
ptr = mem2hex(&__debug_frame->pc, ptr, 4, 0);
15351535
*ptr++ = ';';
15361536

15371537
/*
15381538
* Send frame pointer
15391539
*/
1540-
ptr = pack_hex_byte(ptr, GDB_REG_FP);
1540+
ptr = hex_byte_pack(ptr, GDB_REG_FP);
15411541
*ptr++ = ':';
15421542
ptr = mem2hex(&__debug_frame->fp, ptr, 4, 0);
15431543
*ptr++ = ';';
15441544

15451545
/*
15461546
* Send stack pointer
15471547
*/
1548-
ptr = pack_hex_byte(ptr, GDB_REG_SP);
1548+
ptr = hex_byte_pack(ptr, GDB_REG_SP);
15491549
*ptr++ = ':';
15501550
ptr = mem2hex(&__debug_frame->sp, ptr, 4, 0);
15511551
*ptr++ = ';';

arch/mn10300/kernel/gdb-stub.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -798,44 +798,44 @@ unsigned char *mem2hex(const void *_mem, char *buf, int count, int may_fault)
798798
if ((u32) mem & 1 && count >= 1) {
799799
if (gdbstub_read_byte(mem, ch) != 0)
800800
return 0;
801-
buf = pack_hex_byte(buf, ch[0]);
801+
buf = hex_byte_pack(buf, ch[0]);
802802
mem++;
803803
count--;
804804
}
805805

806806
if ((u32) mem & 3 && count >= 2) {
807807
if (gdbstub_read_word(mem, ch) != 0)
808808
return 0;
809-
buf = pack_hex_byte(buf, ch[0]);
810-
buf = pack_hex_byte(buf, ch[1]);
809+
buf = hex_byte_pack(buf, ch[0]);
810+
buf = hex_byte_pack(buf, ch[1]);
811811
mem += 2;
812812
count -= 2;
813813
}
814814

815815
while (count >= 4) {
816816
if (gdbstub_read_dword(mem, ch) != 0)
817817
return 0;
818-
buf = pack_hex_byte(buf, ch[0]);
819-
buf = pack_hex_byte(buf, ch[1]);
820-
buf = pack_hex_byte(buf, ch[2]);
821-
buf = pack_hex_byte(buf, ch[3]);
818+
buf = hex_byte_pack(buf, ch[0]);
819+
buf = hex_byte_pack(buf, ch[1]);
820+
buf = hex_byte_pack(buf, ch[2]);
821+
buf = hex_byte_pack(buf, ch[3]);
822822
mem += 4;
823823
count -= 4;
824824
}
825825

826826
if (count >= 2) {
827827
if (gdbstub_read_word(mem, ch) != 0)
828828
return 0;
829-
buf = pack_hex_byte(buf, ch[0]);
830-
buf = pack_hex_byte(buf, ch[1]);
829+
buf = hex_byte_pack(buf, ch[0]);
830+
buf = hex_byte_pack(buf, ch[1]);
831831
mem += 2;
832832
count -= 2;
833833
}
834834

835835
if (count >= 1) {
836836
if (gdbstub_read_byte(mem, ch) != 0)
837837
return 0;
838-
buf = pack_hex_byte(buf, ch[0]);
838+
buf = hex_byte_pack(buf, ch[0]);
839839
}
840840

841841
*buf = 0;
@@ -1273,13 +1273,13 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep)
12731273
ptr = mem2hex(title, ptr, sizeof(title) - 1, 0);
12741274

12751275
hx = hex_asc_hi(excep >> 8);
1276-
ptr = pack_hex_byte(ptr, hx);
1276+
ptr = hex_byte_pack(ptr, hx);
12771277
hx = hex_asc_lo(excep >> 8);
1278-
ptr = pack_hex_byte(ptr, hx);
1278+
ptr = hex_byte_pack(ptr, hx);
12791279
hx = hex_asc_hi(excep);
1280-
ptr = pack_hex_byte(ptr, hx);
1280+
ptr = hex_byte_pack(ptr, hx);
12811281
hx = hex_asc_lo(excep);
1282-
ptr = pack_hex_byte(ptr, hx);
1282+
ptr = hex_byte_pack(ptr, hx);
12831283

12841284
ptr = mem2hex(crlf, ptr, sizeof(crlf) - 1, 0);
12851285
*ptr = 0;
@@ -1291,21 +1291,21 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep)
12911291
ptr = mem2hex(tbcberr, ptr, sizeof(tbcberr) - 1, 0);
12921292

12931293
hx = hex_asc_hi(bcberr >> 24);
1294-
ptr = pack_hex_byte(ptr, hx);
1294+
ptr = hex_byte_pack(ptr, hx);
12951295
hx = hex_asc_lo(bcberr >> 24);
1296-
ptr = pack_hex_byte(ptr, hx);
1296+
ptr = hex_byte_pack(ptr, hx);
12971297
hx = hex_asc_hi(bcberr >> 16);
1298-
ptr = pack_hex_byte(ptr, hx);
1298+
ptr = hex_byte_pack(ptr, hx);
12991299
hx = hex_asc_lo(bcberr >> 16);
1300-
ptr = pack_hex_byte(ptr, hx);
1300+
ptr = hex_byte_pack(ptr, hx);
13011301
hx = hex_asc_hi(bcberr >> 8);
1302-
ptr = pack_hex_byte(ptr, hx);
1302+
ptr = hex_byte_pack(ptr, hx);
13031303
hx = hex_asc_lo(bcberr >> 8);
1304-
ptr = pack_hex_byte(ptr, hx);
1304+
ptr = hex_byte_pack(ptr, hx);
13051305
hx = hex_asc_hi(bcberr);
1306-
ptr = pack_hex_byte(ptr, hx);
1306+
ptr = hex_byte_pack(ptr, hx);
13071307
hx = hex_asc_lo(bcberr);
1308-
ptr = pack_hex_byte(ptr, hx);
1308+
ptr = hex_byte_pack(ptr, hx);
13091309

13101310
ptr = mem2hex(crlf, ptr, sizeof(crlf) - 1, 0);
13111311
*ptr = 0;
@@ -1321,20 +1321,20 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep)
13211321
* Send trap type (converted to signal)
13221322
*/
13231323
*ptr++ = 'T';
1324-
ptr = pack_hex_byte(ptr, sigval);
1324+
ptr = hex_byte_pack(ptr, sigval);
13251325

13261326
/*
13271327
* Send Error PC
13281328
*/
1329-
ptr = pack_hex_byte(ptr, GDB_REGID_PC);
1329+
ptr = hex_byte_pack(ptr, GDB_REGID_PC);
13301330
*ptr++ = ':';
13311331
ptr = mem2hex(&regs->pc, ptr, 4, 0);
13321332
*ptr++ = ';';
13331333

13341334
/*
13351335
* Send frame pointer
13361336
*/
1337-
ptr = pack_hex_byte(ptr, GDB_REGID_FP);
1337+
ptr = hex_byte_pack(ptr, GDB_REGID_FP);
13381338
*ptr++ = ':';
13391339
ptr = mem2hex(&regs->a3, ptr, 4, 0);
13401340
*ptr++ = ';';
@@ -1343,7 +1343,7 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep)
13431343
* Send stack pointer
13441344
*/
13451345
ssp = (unsigned long) (regs + 1);
1346-
ptr = pack_hex_byte(ptr, GDB_REGID_SP);
1346+
ptr = hex_byte_pack(ptr, GDB_REGID_SP);
13471347
*ptr++ = ':';
13481348
ptr = mem2hex(&ssp, ptr, 4, 0);
13491349
*ptr++ = ';';

kernel/debug/gdbstub.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void gdbstub_msg_write(const char *s, int len)
217217

218218
/* Pack in hex chars */
219219
for (i = 0; i < wcount; i++)
220-
bufptr = pack_hex_byte(bufptr, s[i]);
220+
bufptr = hex_byte_pack(bufptr, s[i]);
221221
*bufptr = '\0';
222222

223223
/* Move up */
@@ -249,7 +249,7 @@ char *kgdb_mem2hex(char *mem, char *buf, int count)
249249
if (err)
250250
return NULL;
251251
while (count > 0) {
252-
buf = pack_hex_byte(buf, *tmp);
252+
buf = hex_byte_pack(buf, *tmp);
253253
tmp++;
254254
count--;
255255
}
@@ -411,14 +411,14 @@ static char *pack_threadid(char *pkt, unsigned char *id)
411411
limit = id + (BUF_THREAD_ID_SIZE / 2);
412412
while (id < limit) {
413413
if (!lzero || *id != 0) {
414-
pkt = pack_hex_byte(pkt, *id);
414+
pkt = hex_byte_pack(pkt, *id);
415415
lzero = 0;
416416
}
417417
id++;
418418
}
419419

420420
if (lzero)
421-
pkt = pack_hex_byte(pkt, 0);
421+
pkt = hex_byte_pack(pkt, 0);
422422

423423
return pkt;
424424
}
@@ -486,7 +486,7 @@ static void gdb_cmd_status(struct kgdb_state *ks)
486486
dbg_remove_all_break();
487487

488488
remcom_out_buffer[0] = 'S';
489-
pack_hex_byte(&remcom_out_buffer[1], ks->signo);
489+
hex_byte_pack(&remcom_out_buffer[1], ks->signo);
490490
}
491491

492492
static void gdb_get_regs_helper(struct kgdb_state *ks)
@@ -954,7 +954,7 @@ int gdb_serial_stub(struct kgdb_state *ks)
954954
/* Reply to host that an exception has occurred */
955955
ptr = remcom_out_buffer;
956956
*ptr++ = 'T';
957-
ptr = pack_hex_byte(ptr, ks->signo);
957+
ptr = hex_byte_pack(ptr, ks->signo);
958958
ptr += strlen(strcpy(ptr, "thread:"));
959959
int_to_threadref(thref, shadow_pid(current->pid));
960960
ptr = pack_threadid(ptr, thref);

0 commit comments

Comments
 (0)