canutils: Fix minor style issue found in canlib
no functional change Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
f633d11b63
commit
9d67f38062
@ -22,15 +22,10 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
/****************************************************************************
|
||||
@ -63,10 +58,9 @@ int canlib_getbaud(int fd, FAR int *bauds)
|
||||
if (ret != OK)
|
||||
{
|
||||
canerr("CANIOC_GET_BITTIMING failed, errno=%d\n", errno);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
*bauds = timings.bt_baud;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -22,16 +22,10 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <fcntl.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
/****************************************************************************
|
||||
@ -64,10 +58,9 @@ int canlib_getloopback(int fd, FAR bool *loopback)
|
||||
if (ret != OK)
|
||||
{
|
||||
canerr("CANIOC_GET_CONNMODES failed, errno=%d\n", errno);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*loopback = (bool)connmodes.bm_loopback;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
*loopback = connmodes.bm_loopback;
|
||||
return ret;
|
||||
}
|
||||
|
@ -22,16 +22,10 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <fcntl.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
/****************************************************************************
|
||||
@ -46,7 +40,7 @@
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* loopback - pointer to a buffer to store the current silent mode state.
|
||||
* silent - pointer to a buffer to store the current silent mode state.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
@ -64,10 +58,9 @@ int canlib_getsilent(int fd, FAR bool *silent)
|
||||
if (ret != OK)
|
||||
{
|
||||
canerr("CANIOC_GET_CONNMODES failed, errno=%d\n", errno);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*silent = (bool)connmodes.bm_silent;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
*silent = connmodes.bm_silent;
|
||||
return ret;
|
||||
}
|
||||
|
@ -22,15 +22,10 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -22,16 +22,10 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <fcntl.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -22,16 +22,10 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <fcntl.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
/****************************************************************************
|
||||
@ -47,7 +41,7 @@
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* loopback - whether to use loopback mode.
|
||||
* silent - whether to use silent mode.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
|
@ -107,6 +107,8 @@ int canlib_getbaud(int fd, FAR int *bauds);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int canlib_setloopback(int fd, bool loop);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: canlib_getloopback
|
||||
*
|
||||
@ -124,8 +126,6 @@ int canlib_getbaud(int fd, FAR int *bauds);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int canlib_setloopback(int fd, bool loop);
|
||||
|
||||
int canlib_getloopback(int fd, FAR bool *loop);
|
||||
|
||||
/****************************************************************************
|
||||
@ -137,7 +137,7 @@ int canlib_getloopback(int fd, FAR bool *loop);
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* loopback - whether to use loopback mode.
|
||||
* silent - whether to use silent mode.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
@ -156,7 +156,7 @@ int canlib_setsilent(int fd, bool silent);
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* loopback - pointer to a buffer to store the current silent mode state.
|
||||
* silent - pointer to a buffer to store the current silent mode state.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
|
Loading…
Reference in New Issue
Block a user