mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 08:06:34 +02:00
slcanpty: remove redundant asc2nibble()
asc2nibble() is already defined in lib.h. Include lib.h in slcnpty.c so that asc2nibble() does not need to be redefined a second time and adjust the Makefile accordingly. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/all/20221114163848.3398-2-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
committed by
Marc Kleine-Budde
parent
71a0156bd5
commit
4c9f046615
+2
-15
@@ -43,27 +43,14 @@
|
||||
#include <linux/can/raw.h>
|
||||
#include <linux/sockios.h>
|
||||
|
||||
#include "lib.h"
|
||||
|
||||
/* maximum rx buffer len: extended CAN frame with timestamp */
|
||||
#define SLC_MTU (sizeof("T1111222281122334455667788EA5F\r")+1)
|
||||
#define DEVICE_NAME_PTMX "/dev/ptmx"
|
||||
|
||||
#define DEBUG
|
||||
|
||||
static int asc2nibble(char c)
|
||||
{
|
||||
|
||||
if ((c >= '0') && (c <= '9'))
|
||||
return c - '0';
|
||||
|
||||
if ((c >= 'A') && (c <= 'F'))
|
||||
return c - 'A' + 10;
|
||||
|
||||
if ((c >= 'a') && (c <= 'f'))
|
||||
return c - 'a' + 10;
|
||||
|
||||
return 16; /* error */
|
||||
}
|
||||
|
||||
/* read data from pty, send CAN frames to CAN socket and answer commands */
|
||||
int pty2can(int pty, int socket, struct can_filter *fi,
|
||||
int *is_open, int *tstamp)
|
||||
|
||||
Reference in New Issue
Block a user