浏览代码

microblaze: Use unsigned type for proper comparison in cpuinfo*.c

Compare the same types together.

Compilation warnings:
arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c: In function
'set_cpuinfo_pvr_full':
arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:47:20: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]
arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:52:19: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]
arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:57:18: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]
arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:94:20: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]
arch/microblaze/kernel/cpu/cpuinfo-static.c: In function
'set_cpuinfo_static':
arch/microblaze/kernel/cpu/cpuinfo-static.c:40:20: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek 10 年之前
父节点
当前提交
bdb96e3cad
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
  2. 1 1
      arch/microblaze/kernel/cpu/cpuinfo-static.c

+ 1 - 1
arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c

@@ -33,7 +33,7 @@
 void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
 {
 	struct pvr_s pvr;
-	int temp; /* for saving temp value */
+	u32 temp; /* for saving temp value */
 	get_pvr(&pvr);
 
 	CI(ver_code, VERSION);

+ 1 - 1
arch/microblaze/kernel/cpu/cpuinfo-static.c

@@ -22,7 +22,7 @@ static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
 
 void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
 {
-	int i = 0;
+	u32 i = 0;
 
 	ci->use_instr =
 		(fcpu(cpu, "xlnx,use-barrel") ? PVR0_USE_BARREL_MASK : 0) |