Skip to content
Snippets Groups Projects
Commit cc3843e3 authored by Wolfgang Denk's avatar Wolfgang Denk
Browse files

common/kgdb.c: fix 'dereferencing type-punned pointer' warning


and get rid of a couple of unneeded casts.

Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
parent 8d4f4a83
No related branches found
No related tags found
No related merge requests found
...@@ -107,7 +107,7 @@ static char remcomRegBuffer[BUFMAX]; ...@@ -107,7 +107,7 @@ static char remcomRegBuffer[BUFMAX];
static int initialized = 0; static int initialized = 0;
static int kgdb_active = 0, first_entry = 1; static int kgdb_active = 0, first_entry = 1;
static struct pt_regs entry_regs; static struct pt_regs entry_regs;
static u_int error_jmp_buf[BUFMAX/2]; static long error_jmp_buf[BUFMAX/2];
static int longjmp_on_fault = 0; static int longjmp_on_fault = 0;
#ifdef KGDB_DEBUG #ifdef KGDB_DEBUG
static int kdebug = 1; static int kdebug = 1;
...@@ -310,7 +310,7 @@ handle_exception (struct pt_regs *regs) ...@@ -310,7 +310,7 @@ handle_exception (struct pt_regs *regs)
/* probably should check which exception occured as well */ /* probably should check which exception occured as well */
if (longjmp_on_fault) { if (longjmp_on_fault) {
longjmp_on_fault = 0; longjmp_on_fault = 0;
kgdb_longjmp((long*)error_jmp_buf, KGDBERR_MEMFAULT); kgdb_longjmp(error_jmp_buf, KGDBERR_MEMFAULT);
panic("kgdb longjump failed!\n"); panic("kgdb longjump failed!\n");
} }
...@@ -324,7 +324,7 @@ handle_exception (struct pt_regs *regs) ...@@ -324,7 +324,7 @@ handle_exception (struct pt_regs *regs)
printf("kgdb: handle_exception; trap [0x%x]\n", kgdb_trap(regs)); printf("kgdb: handle_exception; trap [0x%x]\n", kgdb_trap(regs));
if (kgdb_setjmp((long*)error_jmp_buf) != 0) if (kgdb_setjmp(error_jmp_buf) != 0)
panic("kgdb: error or fault in entry init!\n"); panic("kgdb: error or fault in entry init!\n");
kgdb_enter(regs, &kd); kgdb_enter(regs, &kd);
...@@ -379,7 +379,7 @@ handle_exception (struct pt_regs *regs) ...@@ -379,7 +379,7 @@ handle_exception (struct pt_regs *regs)
printf("kgdb: remcomInBuffer: %s\n", remcomInBuffer); printf("kgdb: remcomInBuffer: %s\n", remcomInBuffer);
#endif #endif
errnum = kgdb_setjmp((long*)error_jmp_buf); errnum = kgdb_setjmp(error_jmp_buf);
if (errnum == 0) switch (remcomInBuffer[0]) { if (errnum == 0) switch (remcomInBuffer[0]) {
...@@ -532,7 +532,7 @@ void ...@@ -532,7 +532,7 @@ void
kgdb_error(int errnum) kgdb_error(int errnum)
{ {
longjmp_on_fault = 0; longjmp_on_fault = 0;
kgdb_longjmp((long*)error_jmp_buf, errnum); kgdb_longjmp(error_jmp_buf, errnum);
panic("kgdb_error: longjmp failed!\n"); panic("kgdb_error: longjmp failed!\n");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment