[FIX] warnings in swap_writer
authorAnastasia Lyupa <a.lyupa@samsung.com>
Wed, 6 Nov 2013 07:40:04 +0000 (11:40 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 7 Nov 2013 04:12:29 +0000 (04:12 +0000)
build it with -Werror

Change-Id: I4bfec0d589f796655ddfabe98946fbac89a38fd7
Signed-off-by: Anastasia Lyupa <a.lyupa@samsung.com>
build.sh
writer/kernel_operations.h
writer/swap_writer_module.c
writer/swap_writer_module.h

index 8e947aa..1b3688f 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -49,7 +49,7 @@ make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${buffer_dir
 writer_module_name=swap_writer.ko
 writer_inc=${modules_inc}
 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${writer_dir} \
-       extra_cflags="-I${modules_dir}" modules || exit 1
+       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
 
 driver_module_name=swap_driver.ko
 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${driver_dir} \
index 2d856b7..26c2fad 100644 (file)
@@ -63,10 +63,10 @@ static inline u32 get_regs_ret_func(struct pt_regs *regs)
        u32 *sp, addr = 0;
 
        if (user_mode(regs)) {
-               sp = regs->sp;
+               sp = (u32 *)regs->sp;
                if (get_user(addr, sp))
                        printk("failed to dereference a pointer, sp=%p, "
-                              "pc=%p\n", sp, get_regs_ip(regs));
+                              "pc=%lx\n", sp, get_regs_ip(regs));
        } else {
                sp = (u32 *)kernel_stack_pointer(regs);
                addr = *sp;
index 6aa2d0a..e14defd 100644 (file)
@@ -389,7 +389,7 @@ struct proc_unmap {
 static char *pack_proc_unmap(char *payload, unsigned long start,
                             unsigned long end)
 {
-       struct proc_map *pum = (struct proc_unmap *)payload;
+       struct proc_unmap *pum = (struct proc_unmap *)payload;
 
        pum->pid = current->tgid;
        pum->low_addr = start;
@@ -554,8 +554,8 @@ static int pack_args(char *buf, int len, const char *fmt, struct pt_regs *regs)
                case 'd': /* 4 byte(int) */
                        if (len < 4)
                                return -ENOMEM;
-                       tmp_u32 = buf;
-                       *tmp_u32 = arg;
+                       tmp_u32 = (u32 *)buf;
+                       *tmp_u32 = (u32)arg;
                        buf += 4;
                        len -= 4;
                        break;
@@ -564,7 +564,7 @@ static int pack_args(char *buf, int len, const char *fmt, struct pt_regs *regs)
                case 'p': /* 8 byte(pointer) */
                        if (len < 8)
                                return -ENOMEM;
-                       tmp_u64 = buf;
+                       tmp_u64 = (u64 *)buf;
                        *tmp_u64 = (u64)arg;
                        buf += 8;
                        len -= 8;
@@ -572,7 +572,7 @@ static int pack_args(char *buf, int len, const char *fmt, struct pt_regs *regs)
                case 'w': /* 8 byte(double) */
                        if (len < 8 && (i + 1) < cnt)
                                return -ENOMEM;
-                       tmp_u64 = buf;
+                       tmp_u64 = (u64 *)buf;
                        *tmp_u64 = *((u64 *)&args[i]);
                        ++i;
                        buf += 8;
index 07aaf0b..510a711 100644 (file)
@@ -44,6 +44,9 @@ enum PROBE_SUB_TYPE {
 };
 
 struct pt_regs;
+struct dentry;
+struct task_struct;
+struct vm_area_struct;
 
 int init_msg(size_t buf_size);
 void uninit_msg(void);