From 5d5ccf38ee49209a2c6c0af4e4a41e9dcc35ba66 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Tue, 13 Oct 2020 10:03:19 +0200 Subject: [PATCH] fix include order and unify local include placement In commit https://github.com/linux-can/can-utils/commit/b153fe3f3591 ("clang-tidy: sort includes alphabetically") the position of the "lib.h" include has been moved in a way that struct canfd_frame has not been defined anymore and lead to a warning when compiling cangen.c This patch reverts that specific move and unifies the location of local includes at the end of the include list. Signed-off-by: Oliver Hartkopp --- canframelen.c | 3 ++- cangen.c | 3 ++- isotpdump.c | 3 ++- j1939cat.c | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/canframelen.c b/canframelen.c index 6ce3c4d..b708691 100644 --- a/canframelen.c +++ b/canframelen.c @@ -44,7 +44,6 @@ * */ -#include "canframelen.h" #include #include #include @@ -52,6 +51,8 @@ #include #include +#include "canframelen.h" + /** * Functions and types for CRC checks. * diff --git a/cangen.c b/cangen.c index 3641986..d80cf56 100644 --- a/cangen.c +++ b/cangen.c @@ -61,10 +61,11 @@ #include #include -#include "lib.h" #include #include +#include "lib.h" + #define DEFAULT_GAP 200 /* ms */ #define DEFAULT_BURST_COUNT 1 diff --git a/isotpdump.c b/isotpdump.c index 416ede7..6869cc6 100644 --- a/isotpdump.c +++ b/isotpdump.c @@ -55,11 +55,12 @@ #include #include -#include "terminal.h" #include #include #include +#include "terminal.h" + #define NO_CAN_ID 0xFFFFFFFFU const char fc_info [4][9] = { "CTS", "WT", "OVFLW", "reserved" }; diff --git a/j1939cat.c b/j1939cat.c index e6f4205..c79e061 100644 --- a/j1939cat.c +++ b/j1939cat.c @@ -21,6 +21,7 @@ #include #include "libj1939.h" + #define J1939_MAX_ETP_PACKET_SIZE (7 * 0x00ffffff) #define JCAT_BUF_SIZE (1000 * 1024)