CW 10   -  M54418TWR - linux:  compile error help

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

CW 10   -  M54418TWR - linux:  compile error help

581 次查看
francois_boucha
Contributor III

code:

const struct can_frame *cf = (struct can_frame *)skb->data;

 

Error:

dereferencing pointer to incomplete type

 

not sure why I gor this error any idea?

 

thanks

 

FB

标签 (1)
标记 (1)
0 项奖励
1 回复

389 次查看
francois_boucha
Contributor III

the full code is:

 

/* Drop a given socketbuffer if it does not contain a valid CAN frame. */static inline int can_dropped_invalid_skb (struct net_device *dev, struct sk_buff *skb){    const struct can_frame *cf = (struct can_frame *)skb->data;    if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) {        kfree_skb(skb);        dev->stats.tx_dropped++;        return 1;    }    return 0;}

There is the same error here also:

dev->stats.tx_dropped++;

 

And this warning also:

'struct net_device' declared inside parameter list    dev.h    can_llvl 150 error/Sources/header/linux/can    line 62    C/C++ Problem

Is it related?

 

regards

 

0 项奖励