Skip to content

Commit f55a52b

Browse files
vincent-mailholmarckleinebudde
authored andcommitted
can: dev: fix type of get_can_dlc() and get_canfd_dlc() macros
The macros get_can_dlc() and get_canfd_dlc() are not visible in userland. As such, type u8 should be preferred over type __u8. Reference: https://lkml.org/lkml/2020/10/1/708 Signed-off-by: Vincent Mailhol <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent eb88531 commit f55a52b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/linux/can/dev.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ struct can_priv {
8484

8585
/*
8686
* get_can_dlc(value) - helper macro to cast a given data length code (dlc)
87-
* to __u8 and ensure the dlc value to be max. 8 bytes.
87+
* to u8 and ensure the dlc value to be max. 8 bytes.
8888
*
8989
* To be used in the CAN netdriver receive path to ensure conformance with
9090
* ISO 11898-1 Chapter 8.4.2.3 (DLC field)
9191
*/
92-
#define get_can_dlc(i) (min_t(__u8, (i), CAN_MAX_DLC))
93-
#define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC))
92+
#define get_can_dlc(i) (min_t(u8, (i), CAN_MAX_DLC))
93+
#define get_canfd_dlc(i) (min_t(u8, (i), CANFD_MAX_DLC))
9494

9595
/* Check for outgoing skbs that have not been created by the CAN subsystem */
9696
static inline bool can_skb_headroom_valid(struct net_device *dev,

0 commit comments

Comments
 (0)