Fix sparce warnings in sspt modules
authorAlexander Aksenov <a.aksenov@samsung.com>
Thu, 7 Feb 2013 13:04:44 +0000 (17:04 +0400)
committerAlexander Aksenov <a.aksenov@samsung.com>
Thu, 7 Feb 2013 13:04:44 +0000 (17:04 +0400)
driver/sspt/sspt.h
driver/sspt/sspt_debug.h

index 0cfe530..dbecd56 100644 (file)
@@ -37,7 +37,7 @@
 
 static void print_proc_probes(const struct sspt_procs *procs);
 
-struct sspt_procs *get_file_probes(const inst_us_proc_t *task_inst_info)
+static struct sspt_procs *get_file_probes(const inst_us_proc_t *task_inst_info)
 {
        struct sspt_procs *procs = sspt_procs_create(task_inst_info->m_f_dentry, 0);
 
@@ -52,7 +52,7 @@ struct sspt_procs *get_file_probes(const inst_us_proc_t *task_inst_info)
                        int k, j;
                        us_proc_lib_t *p_libs = &task_inst_info->p_libs[i];
                        struct dentry *dentry = p_libs->m_f_dentry;
-                       const char *path = p_libs->path;
+                       char *path = p_libs->path;
                        char *name = strrchr(path, '/');
                        name = name ? ++name : path;
 
@@ -72,7 +72,7 @@ struct sspt_procs *get_file_probes(const inst_us_proc_t *task_inst_info)
                                pd.offset = ip->offset;
                                pd.got_addr = got_addr;
                                pd.pre_handler = ip->jprobe.pre_entry;
-                               pd.jp_handler = ip->jprobe.entry;
+                               pd.jp_handler = (unsigned long) ip->jprobe.entry;
                                pd.rp_handler = ip->retprobe.handler;
 
                                sspt_procs_add_ip_data(procs, dentry, name, &pd);
index c192785..025efd1 100644 (file)
@@ -55,11 +55,13 @@ static void print_page_probes(const struct sspt_page *page)
 
 static void print_file_probes(const struct sspt_file *file)
 {
-       int i, table_size;
+       int i;
+       unsigned long table_size;
        struct sspt_page *page = NULL;
        struct hlist_node *node = NULL;
        struct hlist_head *head = NULL;
-       static const char *NA = "N/A";
+       static unsigned char *NA = "N/A";
+       unsigned char *name;
 
        if (file == NULL) {
                printk("### file_p == NULL\n");
@@ -67,9 +69,9 @@ static void print_file_probes(const struct sspt_file *file)
        }
 
        table_size = (1 << file->page_probes_hash_bits);
-       const char *name = (file->dentry) ? file->dentry->d_iname : NA;
+       name = (file->dentry) ? file->dentry->d_iname : NA;
 
-       printk("### print_file_probes: path=%s, d_iname=%s, table_size=%d, vm_start=%x\n",
+       printk("### print_file_probes: path=%s, d_iname=%s, table_size=%u, vm_start=%x\n",
                        file->name, name, table_size, file->vm_start);
 
        for (i = 0; i < table_size; ++i) {
@@ -91,7 +93,7 @@ static void print_proc_probes(const struct sspt_procs *procs)
        printk("### print_proc_probes\n");
 }
 
-void print_inst_us_proc(const inst_us_proc_t *task_inst_info)
+static void print_inst_us_proc(const inst_us_proc_t *task_inst_info)
 {
        int i;
        int cnt = task_inst_info->libs_count;
@@ -108,7 +110,7 @@ void print_inst_us_proc(const inst_us_proc_t *task_inst_info)
                printk("###     path=%s, cnt_j=%d\n", path, cnt_j);
 
                for (j = 0; j < cnt_j; ++j) {
-                       struct us_ip *ips = &lib->p_ips[j];
+                       us_proc_ip_t *ips = &lib->p_ips[j];
                        unsigned long offset = ips->offset;
                        printk("###         offset=%x\n", offset);
                }