]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Reduce use of a somewhat ugly type-cast.
authorthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 2 May 2007 13:51:38 +0000 (13:51 +0000)
committerthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 2 May 2007 13:51:38 +0000 (13:51 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@265 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/net/can/af_can.c

index 2d691f4acdf090062a110eef2d9e42b24e8f717f..7aac347967d49cb85e204506fec95cd5cc2992ca 100644 (file)
@@ -249,13 +249,14 @@ static int can_create(struct socket *sock, int protocol)
  */
 int can_send(struct sk_buff *skb, int loop)
 {
+       struct sock **tx_sk = (struct sock **)skb->cb;
        int err;
 
        if (loop) {
                /* local loopback of sent CAN frames (default) */
 
                /* indication for the CAN driver: do loopback */
-               *(struct sock **)skb->cb = skb->sk;
+               *tx_sk = skb->sk;
 
                /*
                 * The reference to the originating sock may be also required
@@ -274,7 +275,7 @@ int can_send(struct sk_buff *skb, int loop)
                }
        } else {
                /* indication for the CAN driver: no loopback required */
-               *(struct sock **)skb->cb = NULL;
+               *tx_sk = NULL;
        }
 
        if (!(skb->dev->flags & IFF_UP))