]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
microblaze: Use unsigned type for "for" loop because of comparison-kgdb.c
authorMichal Simek <michal.simek@xilinx.com>
Thu, 18 Dec 2014 14:56:17 +0000 (15:56 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 5 Jan 2015 11:36:45 +0000 (12:36 +0100)
This patch removes warnings reported by W=1:
arch/microblaze/kernel/kgdb.c: In function 'pt_regs_to_gdb_regs':
arch/microblaze/kernel/kgdb.c:43:16: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
arch/microblaze/kernel/kgdb.c:51:16: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
arch/microblaze/kernel/kgdb.c: In function 'gdb_regs_to_pt_regs':
arch/microblaze/kernel/kgdb.c:77:16: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
arch/microblaze/kernel/kgdb.c: In function
'sleeping_thread_to_gdb_regs':
arch/microblaze/kernel/kgdb.c:99:16: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
arch/microblaze/kernel/kgdb.c:103:16: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/kernel/kgdb.c

index 4bd44b6cbc3b5571aee6283534384a64ab99f50f..8736af5806ae49cc16c11a81c643ed23c61f781a 100644 (file)
@@ -36,9 +36,10 @@ struct pvr_s pvr;
 
 void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
 {
-       int i;
+       unsigned int i;
        unsigned long *pt_regb = (unsigned long *)regs;
        int temp;
+
        /* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */
        for (i = 0; i < (sizeof(struct pt_regs) / 4) - 1; i++)
                gdb_regs[i] = pt_regb[i];
@@ -68,7 +69,7 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
 
 void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
 {
-       int i;
+       unsigned int i;
        unsigned long *pt_regb = (unsigned long *)regs;
 
        /* pt_regs and gdb_regs have the same 37 values.
@@ -92,7 +93,7 @@ asmlinkage void microblaze_kgdb_break(struct pt_regs *regs)
 /* untested */
 void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
 {
-       int i;
+       unsigned int i;
        unsigned long *pt_regb = (unsigned long *)(p->thread.regs);
 
        /* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */