summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Nabirushkin <inabirushkin@nvidia.com>2014-12-07 15:26:34 +0300
committerWinnie Hsu <whsu@nvidia.com>2015-01-29 22:05:08 -0800
commit6d956bb7ac0872a090b92d4ed4c842edf3c46963 (patch)
tree25c47f2f7dc718d4073227bbd23e5bfe64d00ed2
parent35b5c2255719adc77d7dade3da0ad41e55f7d295 (diff)
misc: tegra-profiler: fix sparse warnings
Tegra Profiler: fix sparse static warnings. Bug 1587428 Bug 1598009 Change-Id: Ic07b4d6247a506109144ceb1b7401f25373d2137 Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com> Reviewed-on: http://git-master/r/660600 (cherry picked from commit c197f471258f8eb99aa1402ec3a1144b1b34dd65) Reviewed-on: http://git-master/r/672041 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
-rw-r--r--drivers/misc/tegra-profiler/dwarf_unwind.c8
-rw-r--r--drivers/misc/tegra-profiler/eh_unwind.c12
-rw-r--r--drivers/misc/tegra-profiler/hrt.h2
-rw-r--r--drivers/misc/tegra-profiler/quadd.h5
-rw-r--r--drivers/misc/tegra-profiler/version.h2
5 files changed, 16 insertions, 13 deletions
diff --git a/drivers/misc/tegra-profiler/dwarf_unwind.c b/drivers/misc/tegra-profiler/dwarf_unwind.c
index c71e26671577..8699becaa645 100644
--- a/drivers/misc/tegra-profiler/dwarf_unwind.c
+++ b/drivers/misc/tegra-profiler/dwarf_unwind.c
@@ -70,7 +70,7 @@ enum {
DW_CFA_UNSET,
DW_CFA_REG_OFFSET,
DW_CFA_EXP,
-} cfa_how;
+};
struct dw_eh_frame_hdr {
unsigned char version;
@@ -104,7 +104,7 @@ struct dwarf_cpu_context {
};
struct quadd_dwarf_context {
- struct dwarf_cpu_context * __percpu cpu_ctx;
+ struct dwarf_cpu_context __percpu *cpu_ctx;
atomic_t started;
};
@@ -1634,7 +1634,7 @@ unwind_frame(struct ex_region_info *ri,
if (!validate_stack_addr(addr, vma_sp, sizeof(unsigned long)))
return -QUADD_URC_SP_INCORRECT;
- err = read_user_data((unsigned long *)addr, return_addr);
+ err = read_user_data((unsigned long __user *)addr, return_addr);
if (err < 0)
return err;
@@ -1656,7 +1656,7 @@ unwind_frame(struct ex_region_info *ri,
if (!validate_stack_addr(addr, vma_sp, sizeof(unsigned long)))
return -QUADD_URC_SP_INCORRECT;
- err = read_user_data((unsigned long *)addr, fp);
+ err = read_user_data((unsigned long __user *)addr, fp);
if (err < 0)
return err;
diff --git a/drivers/misc/tegra-profiler/eh_unwind.c b/drivers/misc/tegra-profiler/eh_unwind.c
index a097fd8d1067..0fecf0b1059d 100644
--- a/drivers/misc/tegra-profiler/eh_unwind.c
+++ b/drivers/misc/tegra-profiler/eh_unwind.c
@@ -119,7 +119,7 @@ validate_mmap_addr(struct quadd_mmap_area *mmap,
#define read_user_data(addr, retval) \
({ \
- int ret; \
+ long ret; \
\
pagefault_disable(); \
ret = __get_user(retval, addr); \
@@ -728,7 +728,7 @@ unwind_exec_insn(struct quadd_mmap_area *mmap,
((insn & 0x3f) << 2) + 4, ctrl->vrs[SP]);
} else if ((insn & 0xf0) == 0x80) {
unsigned long mask;
- u32 *vsp = (u32 *)(unsigned long)ctrl->vrs[SP];
+ u32 __user *vsp = (u32 __user *)(unsigned long)ctrl->vrs[SP];
int load_sp, reg = 4;
insn = (insn << 8) | unwind_get_byte(mmap, ctrl, &err);
@@ -764,7 +764,7 @@ unwind_exec_insn(struct quadd_mmap_area *mmap,
ctrl->vrs[SP] = ctrl->vrs[insn & 0x0f];
pr_debug("CMD_REG_TO_SP: vsp = {r%lu}\n", insn & 0x0f);
} else if ((insn & 0xf0) == 0xa0) {
- u32 *vsp = (u32 *)(unsigned long)ctrl->vrs[SP];
+ u32 __user *vsp = (u32 __user *)(unsigned long)ctrl->vrs[SP];
unsigned int reg;
/* pop R4-R[4+bbb] */
@@ -795,7 +795,7 @@ unwind_exec_insn(struct quadd_mmap_area *mmap,
pr_debug("CMD_FINISH\n");
} else if (insn == 0xb1) {
unsigned long mask = unwind_get_byte(mmap, ctrl, &err);
- u32 *vsp = (u32 *)(unsigned long)ctrl->vrs[SP];
+ u32 __user *vsp = (u32 __user *)(unsigned long)ctrl->vrs[SP];
int reg = 0;
if (err < 0)
@@ -840,7 +840,7 @@ unwind_exec_insn(struct quadd_mmap_area *mmap,
ctrl->vrs[SP]);
} else if (insn == 0xb3 || insn == 0xc8 || insn == 0xc9) {
unsigned long data, reg_from, reg_to;
- u32 *vsp = (u32 *)(unsigned long)ctrl->vrs[SP];
+ u32 __user *vsp = (u32 __user *)(unsigned long)ctrl->vrs[SP];
data = unwind_get_byte(mmap, ctrl, &err);
if (err < 0)
@@ -869,7 +869,7 @@ unwind_exec_insn(struct quadd_mmap_area *mmap,
} else if ((insn & 0xf8) == 0xb8 || (insn & 0xf8) == 0xd0) {
unsigned long reg_to;
unsigned long data = insn & 0x07;
- u32 *vsp = (u32 *)(unsigned long)ctrl->vrs[SP];
+ u32 __user *vsp = (u32 __user *)(unsigned long)ctrl->vrs[SP];
reg_to = 8 + data;
diff --git a/drivers/misc/tegra-profiler/hrt.h b/drivers/misc/tegra-profiler/hrt.h
index 3361c61e6f3f..9fd9c97d238a 100644
--- a/drivers/misc/tegra-profiler/hrt.h
+++ b/drivers/misc/tegra-profiler/hrt.h
@@ -42,7 +42,7 @@ struct quadd_cpu_context {
struct timecounter;
struct quadd_hrt_ctx {
- struct quadd_cpu_context * __percpu cpu_ctx;
+ struct quadd_cpu_context __percpu *cpu_ctx;
u64 sample_period;
unsigned long low_addr;
diff --git a/drivers/misc/tegra-profiler/quadd.h b/drivers/misc/tegra-profiler/quadd.h
index c25835e29f09..bb47f7114904 100644
--- a/drivers/misc/tegra-profiler/quadd.h
+++ b/drivers/misc/tegra-profiler/quadd.h
@@ -1,7 +1,7 @@
/*
* drivers/misc/tegra-profiler/quadd.h
*
- * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -67,4 +67,7 @@ struct quadd_ctx {
void quadd_get_state(struct quadd_module_state *state);
+int tegra_profiler_try_lock(void);
+void tegra_profiler_unlock(void);
+
#endif /* __QUADD_H */
diff --git a/drivers/misc/tegra-profiler/version.h b/drivers/misc/tegra-profiler/version.h
index 98728a377e37..c96c50756d37 100644
--- a/drivers/misc/tegra-profiler/version.h
+++ b/drivers/misc/tegra-profiler/version.h
@@ -18,7 +18,7 @@
#ifndef __QUADD_VERSION_H
#define __QUADD_VERSION_H
-#define QUADD_MODULE_VERSION "1.86"
+#define QUADD_MODULE_VERSION "1.87"
#define QUADD_MODULE_BRANCH "Dev"
#endif /* __QUADD_VERSION_H */