root@spao-VirtualBox:/home/work/test_03# make
ARCH=arm make CROSS_COMPILE=arm-generic-linux-gnueabi- -C /home/work/build_s5pv210 SUBDIRS=/home/work/test_03 modules
make[1]: Entering directory `/home/work/build_s5pv210'
make -C /home/work/linux-2.6.35-s5pv210 O=/home/work/build_s5pv210/. modules
  CC [M]  /home/work/test_03/call_dev.o
/home/work/test_03/call_dev.c: In function 'call_read':
/home/work/test_03/call_dev.c:30: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result
/home/work/test_03/call_dev.c: In function 'call_write':
/home/work/test_03/call_dev.c:36: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/work/test_03/call_dev.mod.o
  LD [M]  /home/work/test_03/call_dev.ko
make[1]: Leaving directory `/home/work/build_s5pv210'
chmod 777 *
cp *.ko /nfs

ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ

open 함수와 close(release) 함수까지 구현했을때는 에러가 없었는데요

read 와 write를 구현하고나서 컴파일 하는데 warning 이 나네요

 틀린부분이 없는것 같은데..

 

참고로 소스는 다음과 같구요 ㅠ

ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ

call_dev.c

ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ

1 #include <linux/kernel.h>
  2 #include <linux/init.h>
  3 #include <linux/module.h>
  4 #include <linux/fs.h>
  5 #include <linux/errno.h>
  6 #include <linux/types.h>
  7 #include <linux/fcntl.h>
  8 #include <asm/uaccess.h>
  9 #include <linux/slab.h>
 10
 11 #define CALL_DEV_NAME       "call_dev"
 12 #define CALL_DEV_MAJOR      240
 13
 14 static char *buff = NULL;
 15
 16 int call_open (struct inode *inode,struct file *filp)
 17 {
 18     printk("device open\n");
 19     return 0;
 20 }
 21
 22 int call_release (struct inode *inode ,struct file * filp)
 23 {
 24     printk("device close\n");
 25     return 0;
 26 }
 27
 28 ssize_t call_read(struct file *filp,char *buf,size_t count,loff_t *f_pos)
 29 {
 30     copy_to_user(buf,buff,count);
 31     return count;
 32 }
 33
 34 ssize_t call_write(struct file *filp,const char *buf,size_t count,loff_t *f_pos)
 35 {
 36     copy_from_user(buff,buf,count);
 37     return count;
 38 }
 39
 40
 41 struct file_operations call_fops =
 42 {
 43     .owner = THIS_MODULE,
 44     .open = call_open,
 45     .release = call_release,
 46     .read = call_read,
 47     .write = call_write,
 48 };

 50
 51 int __init call_init(void)
 52 {
 53      int result;
 54      printk("module init !! \n");
 55
 56      buff = (char *)kmalloc(1024,GFP_KERNEL);
 57
 58      result = register_chrdev(CALL_DEV_MAJOR,CALL_DEV_NAME, &call_fops);
 59
 60      if (result < 0 )
 61      {
 62          return result;
 63      }
 64
 65      return 0;
 66 }
 67
 68 void __exit call_exit(void)
 69 {
 70     printk("module exit!! \n");
 71     unregister_chrdev(CALL_DEV_MAJOR,CALL_DEV_NAME);
 72     kfree(buff);
 73 }
 74
 75 module_init(call_init);
 76 module_exit(call_exit);
 77 MODULE_LICENSE("GPL");
 78

 

문제점을 못찾겟네요 ㅠ 조언 부탁드립니다.