canutils: Fix minor style issue found in canlib

no functional change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2024-04-07 13:28:07 +08:00 committed by Alan Carvalho de Assis
parent f633d11b63
commit 9d67f38062
7 changed files with 21 additions and 58 deletions

View File

@ -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;
}

View File

@ -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;
return ret;
}
*loopback = (bool)connmodes.bm_loopback;
*loopback = connmodes.bm_loopback;
return ret;
}

View File

@ -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;
return ret;
}
*silent = (bool)connmodes.bm_silent;
*silent = connmodes.bm_silent;
return ret;
}

View File

@ -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>
/****************************************************************************

View File

@ -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>
/****************************************************************************

View File

@ -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)

View File

@ -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)