]> rtime.felk.cvut.cz Git - socketcan-devel.git/blobdiff - kernel/2.6/net/can/bcm.c
net: convert %p usage to %pK
[socketcan-devel.git] / kernel / 2.6 / net / can / bcm.c
index e552e883258e9fa88c7fcb00af8f9bce73347f0e..1b013a1b409245676059ef396fd75ff5fe1a6b54 100644 (file)
@@ -181,9 +181,15 @@ static int bcm_proc_show(struct seq_file *m, void *v)
        struct bcm_sock *bo = bcm_sk(sk);
        struct bcm_op *op;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
        seq_printf(m, ">>> socket %p", sk->sk_socket);
        seq_printf(m, " / sk %p", sk);
        seq_printf(m, " / bo %p", bo);
+#else
+       seq_printf(m, ">>> socket %pK", sk->sk_socket);
+       seq_printf(m, " / sk %pK", sk);
+       seq_printf(m, " / bo %pK", bo);
+#endif
        seq_printf(m, " / dropped %lu", bo->dropped_usr_msgs);
        seq_printf(m, " / bound %s", bcm_proc_getifname(ifname, bo->ifindex));
        seq_printf(m, " <<<\n");
@@ -1628,6 +1634,9 @@ static int bcm_connect(struct socket *sock, struct sockaddr *uaddr, int len,
        struct sock *sk = sock->sk;
        struct bcm_sock *bo = bcm_sk(sk);
 
+       if (len < sizeof(*addr))
+               return -EINVAL;
+
        if (bo->bound)
                return -EISCONN;
 
@@ -1734,7 +1743,7 @@ static struct proto bcm_proto __read_mostly = {
        .init       = bcm_init,
 };
 
-static struct can_proto bcm_can_proto __read_mostly = {
+static const struct can_proto bcm_can_proto = {
        .type       = SOCK_DGRAM,
        .protocol   = CAN_BCM,
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)