Skip to content

Commit

Permalink
net/can: can_dropped_invalid_skb can be boolean
Browse files Browse the repository at this point in the history
This patch makes can_dropped_invalid_skb return bool due to this
particular function only using either one or zero as its return
value.

No functional change.

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yaowei Bai authored and David S. Miller committed Oct 9, 2015
1 parent 875e082 commit d6fbaea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/can/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct can_priv {
#define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC))

/* Drop a given socketbuffer if it does not contain a valid CAN frame. */
static inline int can_dropped_invalid_skb(struct net_device *dev,
static inline bool can_dropped_invalid_skb(struct net_device *dev,
struct sk_buff *skb)
{
const struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
Expand All @@ -94,12 +94,12 @@ static inline int can_dropped_invalid_skb(struct net_device *dev,
} else
goto inval_skb;

return 0;
return false;

inval_skb:
kfree_skb(skb);
dev->stats.tx_dropped++;
return 1;
return true;
}

static inline bool can_is_canfd_skb(const struct sk_buff *skb)
Expand Down

0 comments on commit d6fbaea

Please sign in to comment.