Fix the following compiler warning:
| mcp251xfd/mcp251xfd-regmap.c:38:4: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
| fscanf(reg_file, "%*[^\n]\n");
| ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Reported-by: https://github.com/Chaitanya84
Link: https://github.com/linux-can/can-utils/pull/506
can-utils: support CAN XL
This patch set adds support for CAN XL including VCIDs (Linux v6.9+)
Tools that completely support CAN XL:
candump
cangen
canlogserver
canplayer
cansend
log2long
CC/FD-only tools that have been adapted to the lib.[ch] changes:
log2asc
asc2log
Main changes:
lib/cangen: add documentation for CAN XL ASCII representation
lib: remove separate maxdlen parameter as every needed info is part of the CAN frame now
lib: remove fprint functions and only support sprint
lib: rework for static single buffer to contain a complete ASCII CAN XL frame
lib: introduce a CAN frame unit type to contain CAN CC/FD/XL frames in one union
canplayer/log2asc/log2long: make sscanf() buffer length aware
cangen: fix views for some features for long CAN frame output
general cleanups and buffer overflow safety measures
Make sure the library functions to convert CAN frames into ASCII
represenation do not exceed the given buffer size. This also applies
to the long CAN frame output library function.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Move the curly brackets to the start of the next line to follow the
common coding style in can-utils.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
The 'long' CAN frame representation does not really fit for CAN XL content.
Therefore just a cropped output is provided to be able to see the CAN XL
header information and up to 64 byte of data (without binary or swap
formating options). To get the full qualified CAN XL content use the log
file format.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Build the CAN frame ASCII output inside a single (big) buffer as
preparation for CAN XL support.
This unifies different output modes (fprintf/sprintf/printf) at
the time of the CAN frame text generation.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Replace maxdlen parameter and use CANFD_FDF flags instead.
Since the CANFD_FDF flag has been introduced in can.h the struct canfd_frame
can be used for CAN CC and CAN FD frames as a dual-use data structure.
Remove the extra maxdlen parameter in library calls and only use the
CANFD_FDF flag to differentiate the two CAN CC/FD frames.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
slcanpty.c: In function ‘pty2can’:
slcanpty.c:105:21: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
105 | buf[nbytes] = 0;
| ~~~~~~~~~~~~^~~
slcanpty.c:58:21: note: at offset [-2147483647, -1] into destination object ‘buf’ of size 200
58 | static char buf[200];
| ^~~
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>