diff --git a/include/linux/can.h b/include/linux/can.h index 2b7d511..de5e531 100644 --- a/include/linux/can.h +++ b/include/linux/can.h @@ -218,10 +218,10 @@ struct canxl_frame { __u8 data[CANXL_MAX_DLEN]; }; -#define CAN_MTU (sizeof(struct can_frame)) -#define CANFD_MTU (sizeof(struct canfd_frame)) -#define CANXL_MTU (sizeof(struct canxl_frame)) -#define CANXL_HDR_SIZE (offsetof(struct canxl_frame, data)) +#define CAN_MTU (int)(sizeof(struct can_frame)) +#define CANFD_MTU (int)(sizeof(struct canfd_frame)) +#define CANXL_MTU (int)(sizeof(struct canxl_frame)) +#define CANXL_HDR_SIZE (int)(offsetof(struct canxl_frame, data)) #define CANXL_MIN_MTU (CANXL_HDR_SIZE + 64) #define CANXL_MAX_MTU CANXL_MTU diff --git a/lib.c b/lib.c index 1c2ec0c..0ea46e6 100644 --- a/lib.c +++ b/lib.c @@ -522,7 +522,7 @@ int snprintf_long_canframe(char *buf, size_t size, cu_t *cu, int view) } } - if (maxsize > size - 1) { + if (maxsize > (int)size - 1) { /* mark buffer overflow in output */ memset(buf, '-', size - 1); buf[size - 1] = 0;