]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - net/can/canethgw.c
Use the same type for returned variable
[can-eth-gw-linux.git] / net / can / canethgw.c
index d5b030215614a7d5c8312060163f0993a7d13840..e1e9bd2874c506c5c7e5d9a76d73c6da0c3f0cff 100644 (file)
 #include <net/sock.h>
 #include <linux/can.h>
 #include <linux/miscdevice.h>
-#include "canethgw.h"
+#include <linux/can/canethgw.h>
 
 MODULE_LICENSE("GPL");
 
+struct cegw_job
+{
+       struct kref refcount;
+       struct socket* can_sock;
+       struct socket* udp_sock;
+       __u32  udp_dstcnt;
+       struct sockaddr_in udp_dst[0];
+};
+
 static int cegw_udp2can(void *data);
 static int cegw_udp_send(struct socket *udp_sock, struct can_frame *cf,
                struct sockaddr_in* addr);
@@ -258,7 +267,6 @@ static long cegw_ioctl_start(struct file *file, unsigned long arg)
        if (addrlen != sizeof(struct sockaddr_in))
                return -EAFNOSUPPORT;
 
-       /* */
        job = kmalloc(GFP_KERNEL, sizeof(*job) + dstcnt*addrlen );
        if (job == NULL)
                return -ENOMEM;
@@ -301,7 +309,7 @@ static long cegw_ioctl_start(struct file *file, unsigned long arg)
 
 static long cegw_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-       int err;
+       long err;
 
        switch (cmd) {
                case CEGW_IOCTL_START:
@@ -330,9 +338,7 @@ static struct miscdevice cegw_device = {
 
 static int __init cegw_init(void)
 {
-       misc_register(&cegw_device);
-
-       return 0;
+       return misc_register(&cegw_device);
 }
 
 static void __exit cegw_exit(void)
@@ -344,4 +350,3 @@ static void __exit cegw_exit(void)
 
 module_init(cegw_init);
 module_exit(cegw_exit);
-