nuttx: fix multiple 'FAR', 'CODE' and style issues

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2024-08-24 19:21:12 -04:00 committed by Xiang Xiao
parent 5d17e4795a
commit d499ac9d58
275 changed files with 2130 additions and 1986 deletions

View File

@ -67,11 +67,11 @@ Driver Operations
.. c:function:: int dup(int fd);
.. c:function:: int dup2(int fd1, int fd2);
.. c:function:: off_t lseek(int fd, off_t offset, int whence);
.. c:function:: ssize_t pread(int fd, void *buf, size_t nbytes, off_t offset);
.. c:function:: ssize_t pwrite(int fd, const void *buf, size_t nbytes, off_t offset);
.. c:function:: ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset);
.. c:function:: ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset);
.. c:function:: ssize_t read(int fd, void *buf, size_t nbytes);
.. c:function:: int unlink(const char *path);
.. c:function:: ssize_t write(int fd, const void *buf, size_t nbytes);
.. c:function:: int unlink(FAR const char *path);
.. c:function:: ssize_t write(int fd, FAR const void *buf, size_t nbytes);
``sys/ioctl.h``
---------------
@ -81,7 +81,7 @@ Driver Operations
``poll.h``
----------
.. c:function:: int poll(struct pollfd *fds, nfds_t nfds, int timeout)
.. c:function:: int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
Waits for one of a set of file descriptors
to become ready to perform I/O. If none of the events requested (and no

View File

@ -118,7 +118,7 @@ typedef uint8_t spinlock_t;
&& !defined(CONFIG_ARCH_CHIP_LC823450) \
&& !defined(CONFIG_ARCH_CHIP_CXD56XX) \
&& !defined(CONFIG_ARCH_CHIP_RP2040)
static inline_function spinlock_t up_testset(FAR volatile spinlock_t *lock)
static inline_function spinlock_t up_testset(volatile spinlock_t *lock)
{
spinlock_t ret = SP_UNLOCKED;

View File

@ -4304,7 +4304,7 @@ int up_rtc_initialize(void)
*
****************************************************************************/
int up_rtc_gettime(FAR struct timespec *tp)
int up_rtc_gettime(struct timespec *tp)
{
uint64_t timestamp;
timestamp = stm32_eth_ptp_gettime();
@ -4340,7 +4340,7 @@ int up_rtc_gettime(FAR struct timespec *tp)
*
****************************************************************************/
int up_rtc_settime(FAR const struct timespec *tp)
int up_rtc_settime(const struct timespec *tp)
{
struct timespec ptptime;
uint64_t timestamp;

View File

@ -87,7 +87,7 @@
typedef uint64_t spinlock_t;
#if defined(CONFIG_ARCH_HAVE_TESTSET)
static inline_function spinlock_t up_testset(FAR volatile spinlock_t *lock)
static inline_function spinlock_t up_testset(volatile spinlock_t *lock)
{
spinlock_t ret = SP_LOCKED;

View File

@ -139,12 +139,12 @@ void imx9_dma_free(void *memory, size_t size)
}
#ifdef CONFIG_FAT_DMAMEMORY
FAR void *fat_dma_alloc(size_t size)
void *fat_dma_alloc(size_t size)
{
return imx9_dma_alloc(size);
}
void fat_dma_free(FAR void *memory, size_t size)
void fat_dma_free(void *memory, size_t size)
{
imx9_dma_free(memory, size);
}

View File

@ -105,7 +105,7 @@ typedef uintptr_t spinlock_t;
****************************************************************************/
#if defined(CONFIG_ARCH_RV_ISA_A)
static inline_function spinlock_t up_testset(FAR volatile spinlock_t *lock)
static inline_function spinlock_t up_testset(volatile spinlock_t *lock)
{
spinlock_t ret = SP_UNLOCKED;

View File

@ -80,18 +80,18 @@ struct bl808_timer_ch_s
* Private Function Prototypes
****************************************************************************/
int bl808_timer_start(FAR struct timer_lowerhalf_s *lower);
int bl808_timer_stop(FAR struct timer_lowerhalf_s *lower);
int bl808_timer_getstatus(FAR struct timer_lowerhalf_s *lower,
FAR struct timer_status_s *status);
int bl808_timer_settimeout(FAR struct timer_lowerhalf_s *lower,
int bl808_timer_start(struct timer_lowerhalf_s *lower);
int bl808_timer_stop(struct timer_lowerhalf_s *lower);
int bl808_timer_getstatus(struct timer_lowerhalf_s *lower,
struct timer_status_s *status);
int bl808_timer_settimeout(struct timer_lowerhalf_s *lower,
uint32_t timeout);
void bl808_timer_setcallback(FAR struct timer_lowerhalf_s *lower,
CODE tccb_t callback, FAR void *arg);
int bl808_timer_ioctl(FAR struct timer_lowerhalf_s *lower,
void bl808_timer_setcallback(struct timer_lowerhalf_s *lower,
tccb_t callback, void *arg);
int bl808_timer_ioctl(struct timer_lowerhalf_s *lower,
int cmd, unsigned long arg);
int bl808_timer_maxtimeout(FAR struct timer_lowerhalf_s *lower,
FAR uint32_t *maxtimeout);
int bl808_timer_maxtimeout(struct timer_lowerhalf_s *lower,
uint32_t *maxtimeout);
/****************************************************************************
* Private Data
@ -215,7 +215,7 @@ static int __timer_interrupt(int irq, void *context, void *arg)
*
****************************************************************************/
int bl808_timer_start(FAR struct timer_lowerhalf_s *lower)
int bl808_timer_start(struct timer_lowerhalf_s *lower)
{
struct bl808_timer_ch_s *priv = (struct bl808_timer_ch_s *)lower;
if (TIMER_GET_CH(priv->blk_ch) == 0)
@ -269,7 +269,7 @@ int bl808_timer_start(FAR struct timer_lowerhalf_s *lower)
*
****************************************************************************/
int bl808_timer_stop(FAR struct timer_lowerhalf_s *lower)
int bl808_timer_stop(struct timer_lowerhalf_s *lower)
{
struct bl808_timer_ch_s *priv = (struct bl808_timer_ch_s *)lower;
@ -304,8 +304,8 @@ int bl808_timer_stop(FAR struct timer_lowerhalf_s *lower)
*
****************************************************************************/
int bl808_timer_getstatus(FAR struct timer_lowerhalf_s *lower,
FAR struct timer_status_s *status)
int bl808_timer_getstatus(struct timer_lowerhalf_s *lower,
struct timer_status_s *status)
{
struct bl808_timer_ch_s *priv = (struct bl808_timer_ch_s *)lower;
uint32_t current_count;
@ -338,7 +338,7 @@ int bl808_timer_getstatus(FAR struct timer_lowerhalf_s *lower,
*
****************************************************************************/
int bl808_timer_settimeout(FAR struct timer_lowerhalf_s *lower,
int bl808_timer_settimeout(struct timer_lowerhalf_s *lower,
uint32_t timeout)
{
struct bl808_timer_ch_s *priv = (struct bl808_timer_ch_s *)lower;
@ -408,8 +408,8 @@ int bl808_timer_settimeout(FAR struct timer_lowerhalf_s *lower,
*
****************************************************************************/
void bl808_timer_setcallback(FAR struct timer_lowerhalf_s *lower,
CODE tccb_t callback, FAR void *arg)
void bl808_timer_setcallback(struct timer_lowerhalf_s *lower,
tccb_t callback, void *arg)
{
struct bl808_timer_ch_s *priv = (struct bl808_timer_ch_s *)lower;
priv->callback = callback;
@ -424,7 +424,7 @@ void bl808_timer_setcallback(FAR struct timer_lowerhalf_s *lower,
*
****************************************************************************/
int bl808_timer_ioctl(FAR struct timer_lowerhalf_s *lower,
int bl808_timer_ioctl(struct timer_lowerhalf_s *lower,
int cmd, unsigned long arg)
{
/* No additional ioctl commands implemented */
@ -441,8 +441,8 @@ int bl808_timer_ioctl(FAR struct timer_lowerhalf_s *lower,
*
****************************************************************************/
int bl808_timer_maxtimeout(FAR struct timer_lowerhalf_s *lower,
FAR uint32_t *maxtimeout)
int bl808_timer_maxtimeout(struct timer_lowerhalf_s *lower,
uint32_t *maxtimeout)
{
/* Timer comparators are 32-bit */

View File

@ -72,17 +72,17 @@ struct bl808_wdt_s
* Private Function Prototypes
****************************************************************************/
int bl808_wdt_start(FAR struct watchdog_lowerhalf_s *lower);
int bl808_wdt_stop(FAR struct watchdog_lowerhalf_s *lower);
int bl808_wdt_keepalive(FAR struct watchdog_lowerhalf_s *lower);
int bl808_wdt_getstatus(FAR struct watchdog_lowerhalf_s *lower,
FAR struct watchdog_status_s *status);
int bl808_wdt_settimeout(FAR struct watchdog_lowerhalf_s *lower,
uint32_t timeout);
xcpt_t bl808_wdt_capture(FAR struct watchdog_lowerhalf_s *lower,
CODE xcpt_t callback);
int bl808_wdt_ioctl(FAR struct watchdog_lowerhalf_s *lower,
int cmd, unsigned long arg);
int bl808_wdt_start(struct watchdog_lowerhalf_s *lower);
int bl808_wdt_stop(struct watchdog_lowerhalf_s *lower);
int bl808_wdt_keepalive(struct watchdog_lowerhalf_s *lower);
int bl808_wdt_getstatus(struct watchdog_lowerhalf_s *lower,
struct watchdog_status_s *status);
int bl808_wdt_settimeout(struct watchdog_lowerhalf_s *lower,
uint32_t timeout);
xcpt_t bl808_wdt_capture(struct watchdog_lowerhalf_s *lower,
xcpt_t callback);
int bl808_wdt_ioctl(struct watchdog_lowerhalf_s *lower,
int cmd, unsigned long arg);
/****************************************************************************
* Private Data
@ -161,7 +161,7 @@ static int __wdt_interrupt(int irq, void *context, void *arg)
*
****************************************************************************/
int bl808_wdt_start(FAR struct watchdog_lowerhalf_s *lower)
int bl808_wdt_start(struct watchdog_lowerhalf_s *lower)
{
struct bl808_wdt_s *priv = (struct bl808_wdt_s *)lower;
@ -196,7 +196,7 @@ int bl808_wdt_start(FAR struct watchdog_lowerhalf_s *lower)
*
****************************************************************************/
int bl808_wdt_stop(FAR struct watchdog_lowerhalf_s *lower)
int bl808_wdt_stop(struct watchdog_lowerhalf_s *lower)
{
struct bl808_wdt_s *priv = (struct bl808_wdt_s *)lower;
@ -228,7 +228,7 @@ int bl808_wdt_stop(FAR struct watchdog_lowerhalf_s *lower)
*
****************************************************************************/
int bl808_wdt_keepalive(FAR struct watchdog_lowerhalf_s *lower)
int bl808_wdt_keepalive(struct watchdog_lowerhalf_s *lower)
{
struct bl808_wdt_s *priv = (struct bl808_wdt_s *)lower;
@ -263,8 +263,8 @@ int bl808_wdt_keepalive(FAR struct watchdog_lowerhalf_s *lower)
*
****************************************************************************/
int bl808_wdt_getstatus(FAR struct watchdog_lowerhalf_s *lower,
FAR struct watchdog_status_s *status)
int bl808_wdt_getstatus(struct watchdog_lowerhalf_s *lower,
struct watchdog_status_s *status)
{
struct bl808_wdt_s *priv = (struct bl808_wdt_s *)lower;
@ -295,8 +295,8 @@ int bl808_wdt_getstatus(FAR struct watchdog_lowerhalf_s *lower,
*
****************************************************************************/
int bl808_wdt_settimeout(FAR struct watchdog_lowerhalf_s *lower,
uint32_t timeout)
int bl808_wdt_settimeout(struct watchdog_lowerhalf_s *lower,
uint32_t timeout)
{
struct bl808_wdt_s *priv = (struct bl808_wdt_s *)lower;
@ -342,8 +342,8 @@ int bl808_wdt_settimeout(FAR struct watchdog_lowerhalf_s *lower,
*
****************************************************************************/
xcpt_t bl808_wdt_capture(FAR struct watchdog_lowerhalf_s *lower,
CODE xcpt_t callback)
xcpt_t bl808_wdt_capture(struct watchdog_lowerhalf_s *lower,
xcpt_t callback)
{
struct bl808_wdt_s *priv = (struct bl808_wdt_s *)lower;
xcpt_t prev_callback = priv->callback;
@ -396,8 +396,8 @@ xcpt_t bl808_wdt_capture(FAR struct watchdog_lowerhalf_s *lower,
*
****************************************************************************/
int bl808_wdt_ioctl(FAR struct watchdog_lowerhalf_s *lower,
int cmd, unsigned long arg)
int bl808_wdt_ioctl(struct watchdog_lowerhalf_s *lower,
int cmd, unsigned long arg)
{
/* No additional ioctl commands implemented */

View File

@ -154,13 +154,13 @@ struct mcpwm_motor_lowerhalf_s
{
/* The following block is part of the upper-half device struct */
FAR const struct motor_ops_s *ops; /* Arch-specific operations */
uint8_t opmode; /* Motor operation mode */
uint8_t opflags; /* Motor operation flags */
struct motor_limits_s limits; /* Motor absolute limits */
struct motor_params_s param; /* Motor settings */
struct motor_state_s state; /* Motor state */
FAR void *priv; /* Private data */
const struct motor_ops_s *ops; /* Arch-specific operations */
uint8_t opmode; /* Motor operation mode */
uint8_t opflags; /* Motor operation flags */
struct motor_limits_s limits; /* Motor absolute limits */
struct motor_params_s param; /* Motor settings */
struct motor_state_s state; /* Motor state */
void *priv; /* Private data */
/* The following is private to the ESP MCPWM driver */

View File

@ -224,10 +224,10 @@ struct rmt_dev_lowerhalf_s
{
/* The following block is part of the upper-half device struct */
FAR const struct rmt_ops_s *ops;
FAR struct circbuf_s *circbuf;
sem_t *recvsem;
int minor;
const struct rmt_ops_s *ops;
struct circbuf_s *circbuf;
sem_t *recvsem;
int minor;
/* The following is private to the ESP32 RMT driver */
@ -338,8 +338,8 @@ static int rmt_write_items(rmt_channel_t channel,
bool wait_tx_done);
static ssize_t esp_rmt_read(struct rmt_dev_s *dev, char *buffer,
size_t buflen);
static ssize_t esp_rmt_write(FAR struct rmt_dev_s *dev,
FAR const char *buffer,
static ssize_t esp_rmt_write(struct rmt_dev_s *dev,
const char *buffer,
size_t buflen);
static struct rmt_dev_s
*esp_rmtinitialize(struct rmt_channel_config_s config);

View File

@ -110,8 +110,8 @@ static void esp_temp_sensor_register(struct esp_temp_priv_s *priv);
static int esp_temperature_sensor_install(struct esp_temp_priv_s *priv,
struct esp_temp_sensor_config_t cfg);
static void esp_temperature_sensor_uninstall(struct esp_temp_priv_s *priv);
static int esp_temperature_sensor_get_celsius(FAR struct file *filep,
FAR char *buffer,
static int esp_temperature_sensor_get_celsius(struct file *filep,
char *buffer,
size_t buflen);
/****************************************************************************
@ -444,14 +444,14 @@ static void esp_temperature_sensor_uninstall(struct esp_temp_priv_s *priv)
*
****************************************************************************/
static int esp_temperature_sensor_get_celsius(FAR struct file *filep,
FAR char *buffer,
static int esp_temperature_sensor_get_celsius(struct file *filep,
char *buffer,
size_t buflen)
{
uint32_t tsens_out;
FAR struct inode *inode = filep->f_inode;
FAR struct esp_temp_priv_s *priv = inode->i_private;
FAR int *out = (FAR int *) buffer;
struct inode *inode = filep->f_inode;
struct esp_temp_priv_s *priv = inode->i_private;
int *out = (int *)buffer;
nxmutex_lock(&priv->lock);
if (priv == NULL)

View File

@ -97,7 +97,7 @@ static const char *g_reasons_str[RISCV_MAX_EXCEPTION + 1] =
int riscv_exception(int mcause, void *regs, void *args)
{
#ifdef CONFIG_ARCH_KERNEL_STACK
FAR struct tcb_s *tcb = this_task();
struct tcb_s *tcb = this_task();
#endif
uintreg_t cause = mcause & RISCV_IRQ_MASK;

View File

@ -159,11 +159,10 @@ ice40_get_status(struct ice40_dev_s *dev)
*
****************************************************************************/
FAR struct ice40_dev_s *
esp32c3_ice40_initialize(const uint16_t cdone_gpio,
const uint16_t crst_gpio,
const uint16_t cs_gpio,
const uint16_t spi_port)
struct ice40_dev_s *esp32c3_ice40_initialize(const uint16_t cdone_gpio,
const uint16_t crst_gpio,
const uint16_t cs_gpio,
const uint16_t spi_port)
{
struct esp32c3_ice40_dev_s *ice40_ptr;

View File

@ -46,7 +46,7 @@
****************************************************************************/
#ifdef CONFIG_RPTUN
static int qemu_ipi_handler(int mcause, FAR void *regs, FAR void *args)
static int qemu_ipi_handler(int mcause, void *regs, void *args)
{
/* Clear IPI (Inter-Processor-Interrupt) */

View File

@ -92,7 +92,7 @@ static int sim_camera_data_start_capture(struct imgdata_s *data,
static int sim_camera_data_stop_capture(struct imgdata_s *data);
static int sim_camera_data_set_buf(struct imgdata_s *data,
uint8_t nr_datafmts,
FAR imgdata_format_t *datafmts,
imgdata_format_t *datafmts,
uint8_t *addr, uint32_t size);
/****************************************************************************
@ -261,7 +261,7 @@ static int sim_camera_data_validate_buf(uint8_t *addr, uint32_t size)
static int sim_camera_data_set_buf(struct imgdata_s *data,
uint8_t nr_datafmts,
FAR imgdata_format_t *datafmts,
imgdata_format_t *datafmts,
uint8_t *addr, uint32_t size)
{
sim_camera_priv_t *priv = (sim_camera_priv_t *)data;

View File

@ -301,7 +301,7 @@ void mm_free(struct mm_heap_s *heap, void *mem)
*
****************************************************************************/
void mm_free_delaylist(FAR struct mm_heap_s *heap)
void mm_free_delaylist(struct mm_heap_s *heap)
{
if (heap)
{

View File

@ -669,10 +669,10 @@ static bool tty_txempty(struct uart_dev_s *dev)
#endif
#ifdef CONFIG_SIM_RAM_UART
static int sim_uartram_register(FAR const char *devname, bool slave)
static int sim_uartram_register(const char *devname, bool slave)
{
char name[NAME_MAX];
FAR struct uart_rambuf_s *shmem;
struct uart_rambuf_s *shmem;
strlcpy(name, strrchr(devname, '/') + 1, NAME_MAX);
shmem = host_allocshmem(name, sizeof(struct uart_rambuf_s) * 2, !slave);

View File

@ -160,13 +160,13 @@ struct mcpwm_motor_lowerhalf_s
{
/* The following block is part of the upper-half device struct */
FAR const struct motor_ops_s *ops; /* Arch-specific operations */
uint8_t opmode; /* Motor operation mode */
uint8_t opflags; /* Motor operation flags */
struct motor_limits_s limits; /* Motor absolute limits */
struct motor_params_s param; /* Motor settings */
struct motor_state_s state; /* Motor state */
FAR void *priv; /* Private data */
const struct motor_ops_s *ops; /* Arch-specific operations */
uint8_t opmode; /* Motor operation mode */
uint8_t opflags; /* Motor operation flags */
struct motor_limits_s limits; /* Motor absolute limits */
struct motor_params_s param; /* Motor settings */
struct motor_state_s state; /* Motor state */
void *priv; /* Private data */
/* The following is private to the ESP MCPWM driver */
@ -199,7 +199,7 @@ struct mcpwm_cap_channel_lowerhalf_s
{
/* The following block is part of the upper-half device struct */
FAR const struct cap_ops_s *ops;
const struct cap_ops_s *ops;
/* The following is private to the ESP MCPWM driver */

View File

@ -270,10 +270,10 @@ struct rmt_dev_lowerhalf_s
{
/* The following block is part of the upper-half device struct */
FAR const struct rmt_ops_s *ops;
FAR struct circbuf_s *circbuf;
sem_t *recvsem;
int minor;
const struct rmt_ops_s *ops;
struct circbuf_s *circbuf;
sem_t *recvsem;
int minor;
/* The following is private to the ESP32 RMT driver */
@ -384,8 +384,8 @@ static int rmt_write_items(rmt_channel_t channel,
bool wait_tx_done);
static ssize_t esp_rmt_read(struct rmt_dev_s *dev, char *buffer,
size_t buflen);
static ssize_t esp_rmt_write(FAR struct rmt_dev_s *dev,
FAR const char *buffer,
static ssize_t esp_rmt_write(struct rmt_dev_s *dev,
const char *buffer,
size_t buflen);
static struct rmt_dev_s
*esp_rmtinitialize(struct rmt_channel_config_s config);

View File

@ -109,8 +109,8 @@ static void esp_temp_sensor_register(struct esp_temp_priv_s *priv);
static int esp_temperature_sensor_install(struct esp_temp_priv_s *priv,
struct esp_temp_sensor_config_t cfg);
static void esp_temperature_sensor_uninstall(struct esp_temp_priv_s *priv);
static int esp_temperature_sensor_get_celsius(FAR struct file *filep,
FAR char *buffer,
static int esp_temperature_sensor_get_celsius(struct file *filep,
char *buffer,
size_t buflen);
/****************************************************************************
@ -443,14 +443,14 @@ static void esp_temperature_sensor_uninstall(struct esp_temp_priv_s *priv)
*
****************************************************************************/
static int esp_temperature_sensor_get_celsius(FAR struct file *filep,
FAR char *buffer,
static int esp_temperature_sensor_get_celsius(struct file *filep,
char *buffer,
size_t buflen)
{
uint32_t tsens_out;
FAR struct inode *inode = filep->f_inode;
FAR struct esp_temp_priv_s *priv = inode->i_private;
FAR int *out = (FAR int *) buffer;
struct inode *inode = filep->f_inode;
struct esp_temp_priv_s *priv = inode->i_private;
int *out = (int *)buffer;
nxmutex_lock(&priv->lock);
if (priv == NULL)

View File

@ -240,7 +240,7 @@ static inline void openeth_set_tx_desc_cnt(int tx_desc_cnt)
static IRAM_ATTR int openeth_isr_handler(int irq, void *context, void *arg)
{
FAR struct netdev_lowerhalf_s *dev = &g_openeth.dev;
struct netdev_lowerhalf_s *dev = &g_openeth.dev;
uint32_t status = REG_READ(OPENETH_INT_SOURCE_REG);
@ -261,9 +261,9 @@ static IRAM_ATTR int openeth_isr_handler(int irq, void *context, void *arg)
return 0;
}
static FAR netpkt_t *openeth_receive(FAR struct netdev_lowerhalf_s *dev)
static netpkt_t *openeth_receive(struct netdev_lowerhalf_s *dev)
{
FAR netpkt_t *pkt = netpkt_alloc(dev, NETPKT_RX);
netpkt_t *pkt = netpkt_alloc(dev, NETPKT_RX);
struct openeth_priv_s *priv = &g_openeth;
@ -322,7 +322,7 @@ err:
*
****************************************************************************/
static int openeth_ifup(FAR struct netdev_lowerhalf_s *dev)
static int openeth_ifup(struct netdev_lowerhalf_s *dev)
{
irqstate_t flags;
@ -357,7 +357,7 @@ static int openeth_ifup(FAR struct netdev_lowerhalf_s *dev)
*
****************************************************************************/
static int openeth_ifdown(FAR struct netdev_lowerhalf_s *dev)
static int openeth_ifdown(struct netdev_lowerhalf_s *dev)
{
irqstate_t flags;
@ -376,10 +376,10 @@ static int openeth_ifdown(FAR struct netdev_lowerhalf_s *dev)
return OK;
}
static int openeth_transmit(FAR struct netdev_lowerhalf_s *dev,
FAR netpkt_t *pkt)
static int openeth_transmit(struct netdev_lowerhalf_s *dev,
netpkt_t *pkt)
{
FAR struct openeth_priv_s *priv = (FAR struct openeth_priv_s *)dev;
struct openeth_priv_s *priv = (struct openeth_priv_s *)dev;
unsigned int len = netpkt_getdatalen(dev, pkt);
/* In QEMU, there never is a TX operation in progress */
@ -455,8 +455,8 @@ err:
int esp32_openeth_initialize(void)
{
int ret;
FAR struct openeth_priv_s *priv = &g_openeth;
FAR struct netdev_lowerhalf_s *dev = &priv->dev;
struct openeth_priv_s *priv = &g_openeth;
struct netdev_lowerhalf_s *dev = &priv->dev;
/* Sanity check */

View File

@ -191,7 +191,7 @@ bool up_textheap_heapmember(void *p)
*
****************************************************************************/
FAR void *up_textheap_data_address(FAR void *p)
void *up_textheap_data_address(void *p)
{
uintptr_t addr = (uintptr_t)p;
if (SOC_DIRAM_IRAM_LOW <= addr && addr < SOC_DIRAM_IRAM_HIGH)
@ -206,7 +206,7 @@ FAR void *up_textheap_data_address(FAR void *p)
addr -= EXTRAM_D_I_BUS_OFFSET;
}
return (FAR void *)addr;
return (void *)addr;
}
/****************************************************************************
@ -251,7 +251,7 @@ IRAM_ATTR void up_textheap_data_sync(void)
****************************************************************************/
#if defined(CONFIG_ARCH_USE_COPY_SECTION)
int up_copy_section(FAR void *dest, FAR const void *src, size_t n)
int up_copy_section(void *dest, const void *src, size_t n)
{
memcpy(up_textheap_data_address(dest), src, n);

View File

@ -277,7 +277,7 @@ static void elf_emit_tcb_note(FAR struct elf_dumpinfo_s *cinfo,
}
else
{
regs = (uintptr_t *)tcb->xcp.regs;
regs = (FAR uintptr_t *)tcb->xcp.regs;
}
if (regs != NULL)
@ -290,8 +290,8 @@ static void elf_emit_tcb_note(FAR struct elf_dumpinfo_s *cinfo,
}
else
{
status.pr_regs[i] =
*(uintptr_t *)((uint8_t *)regs + g_tcbinfo.reg_off.p[i]);
status.pr_regs[i] = *(FAR uintptr_t *)
((FAR uint8_t *)regs + g_tcbinfo.reg_off.p[i]);
}
}
}

View File

@ -164,7 +164,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo)
for (i = 0; i < loadinfo->nctors; i++)
{
FAR uintptr_t *ptr = (uintptr_t *)
FAR uintptr_t *ptr = (FAR uintptr_t *)
((FAR void *)(&loadinfo->ctors)[i]);
binfo("ctor %d: "

View File

@ -165,7 +165,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo)
for (i = 0; i < loadinfo->ndtors; i++)
{
FAR uintptr_t *ptr = (uintptr_t *)
FAR uintptr_t *ptr = (FAR uintptr_t *)
((FAR void *)(&loadinfo->dtors)[i]);
binfo("dtor %d: "

View File

@ -204,7 +204,7 @@ int elf_loadphdrs(FAR struct elf_loadinfo_s *loadinfo)
/* Allocate memory to hold a working copy of the program header table */
loadinfo->phdr = (FAR FAR Elf_Phdr *)kmm_malloc(phdrsize);
loadinfo->phdr = (FAR Elf_Phdr *)kmm_malloc(phdrsize);
if (!loadinfo->phdr)
{
berr("Failed to allocate the program header table. Size: %ld\n",

View File

@ -93,14 +93,14 @@ static inline void nxflat_dumpreaddata(FAR char *buffer, int buflen)
*
****************************************************************************/
int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer,
int nxflat_read(FAR struct nxflat_loadinfo_s *loadinfo, FAR char *buffer,
int readsize, int offset)
{
ssize_t nbytes; /* Number of bytes read */
off_t rpos; /* Position returned by lseek */
char *bufptr; /* Next buffer location to read into */
int bytesleft; /* Number of bytes of .data left to read */
int bytesread; /* Total number of bytes read */
ssize_t nbytes; /* Number of bytes read */
off_t rpos; /* Position returned by lseek */
FAR char *bufptr; /* Next buffer location to read into */
int bytesleft; /* Number of bytes of .data left to read */
int bytesread; /* Total number of bytes read */
binfo("Read %d bytes from offset %d\n", readsize, offset);

View File

@ -39,7 +39,7 @@
#ifdef CONFIG_I2C
void gd32_i2c_initialize(void)
{
FAR struct i2c_master_s *i2c;
struct i2c_master_s *i2c;
int ret;
i2cinfo("Initialize I2c\n");
@ -92,4 +92,4 @@ void gd32_i2c_initialize(void)
#endif
}
#endif
#endif

View File

@ -39,7 +39,7 @@
#ifdef CONFIG_I2C
void gd32_i2c_initialize(void)
{
FAR struct i2c_master_s *i2c;
struct i2c_master_s *i2c;
int ret;
i2cinfo("Initialize I2c\n");
@ -92,4 +92,4 @@ void gd32_i2c_initialize(void)
#endif
}
#endif
#endif

View File

@ -334,7 +334,7 @@ void rp2040_uniqueid_initialize(void)
*
****************************************************************************/
int board_uniqueid(FAR uint8_t *uniqueid)
int board_uniqueid(uint8_t *uniqueid)
{
memcpy(uniqueid, g_uniqueid, CONFIG_BOARDCTL_UNIQUEID_SIZE);
return OK;

View File

@ -52,7 +52,7 @@
****************************************************************************/
#ifdef CONFIG_BOARDCTL_RESET_CAUSE
int board_reset_cause(FAR struct boardioc_reset_cause_s *cause)
int board_reset_cause(struct boardioc_reset_cause_s *cause)
{
int rst_cause;

View File

@ -191,7 +191,7 @@
#ifdef CONFIG_I2C_DRIVER
static void stm32_i2c_register(int bus)
{
FAR struct i2c_master_s *i2c;
struct i2c_master_s *i2c;
int ret;
i2c = stm32_i2cbus_initialize(bus);

View File

@ -56,7 +56,7 @@
int stm32_at24_init(char *path)
{
FAR struct i2c_master_s *i2c;
struct i2c_master_s *i2c;
static bool initialized = false;
int ret;

View File

@ -57,7 +57,7 @@
int stm32_at24_init(char *path)
{
FAR struct i2c_master_s *i2c;
struct i2c_master_s *i2c;
static bool initialized = false;
int ret;

View File

@ -42,7 +42,7 @@ static struct sdio_dev_s *g_sdio_dev;
* Private Functions
****************************************************************************/
static void partition_handler(FAR struct partition_s *part, FAR void *arg)
static void partition_handler(struct partition_s *part, void *arg)
{
unsigned partition = *(int *)arg;
char devname[] = "/dev/mmcsd0p0";

View File

@ -216,7 +216,7 @@ int board_power_off(int status)
#if defined(CONFIG_BUILD_KERNEL) && ! defined(CONFIG_NUTTSBI)
riscv_sbi_system_reset(SBI_SRST_TYPE_SHUTDOWN, SBI_SRST_REASON_NONE);
#else
*(FAR volatile uint32_t *)QEMU_RV_RESET_BASE = QEMU_RV_RESET_DONE;
*(volatile uint32_t *)QEMU_RV_RESET_BASE = QEMU_RV_RESET_DONE;
#endif
UNUSED(status);

View File

@ -59,7 +59,7 @@ static int board_adc_register(int channel)
{
int ret;
char devname[12];
FAR struct adc_dev_s *adcdev;
struct adc_dev_s *adcdev;
adcdev = kmm_malloc(sizeof(struct adc_dev_s));
if (adcdev == NULL)

View File

@ -344,7 +344,7 @@ static void gt911_event(struct gt911_dev_s *dev)
*
****************************************************************************/
static void gt911_worker(FAR void *arg)
static void gt911_worker(void *arg)
{
int ret;
struct gt911_dev_s *dev = (struct gt911_dev_s *)arg;

View File

@ -126,7 +126,7 @@ __attribute__((packed));
* Private Function Prototypes
****************************************************************************/
static void tt21100_worker(FAR void *arg);
static void tt21100_worker(void *arg);
/****************************************************************************
* Private Data
@ -244,7 +244,7 @@ static void tt21100_event(struct tt21100_dev_s *dev)
*
****************************************************************************/
static void tt21100_worker(FAR void *arg)
static void tt21100_worker(void *arg)
{
int ret;
struct i2c_msg_s msg;

View File

@ -110,7 +110,7 @@ static ssize_t cryptof_write(FAR struct file *filep,
static int cryptof_ioctl(FAR struct file *filep,
int cmd, unsigned long arg);
static int cryptof_poll(FAR struct file *filep,
struct pollfd *fds, bool setup);
FAR struct pollfd *fds, bool setup);
static int cryptof_open(FAR struct file *filep);
static int cryptof_close(FAR struct file *filep);
@ -682,7 +682,7 @@ fail:
/* ARGSUSED */
static int cryptof_poll(FAR struct file *filep,
struct pollfd *fds, bool setup)
FAR struct pollfd *fds, bool setup)
{
return 0;
}

View File

@ -919,7 +919,7 @@ FAR struct i2c_master_s *
}
nxrmutex_unlock(&master->devlock);
return (struct i2c_master_s *)inst;
return (FAR struct i2c_master_s *)inst;
}
/****************************************************************************

View File

@ -55,7 +55,7 @@ static int adc_reset(FAR struct adc_dev_s *dev);
static int adc_receive(FAR struct adc_dev_s *dev, uint8_t ch,
int32_t data);
static void adc_notify(FAR struct adc_dev_s *dev);
static int adc_poll(FAR struct file *filep, struct pollfd *fds,
static int adc_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
static int adc_reset_fifo(FAR struct adc_dev_s *dev);
static int adc_samples_on_read(FAR struct adc_dev_s *dev);
@ -523,7 +523,8 @@ static void adc_notify(FAR struct adc_dev_s *dev)
* Name: adc_poll
****************************************************************************/
static int adc_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
static int adc_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
FAR struct inode *inode = filep->f_inode;
FAR struct adc_dev_s *dev = inode->i_private;
@ -583,7 +584,7 @@ static int adc_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
FAR struct pollfd **slot = (FAR struct pollfd **)fds->priv;
/* Remove all memory of the poll setup */

View File

@ -457,7 +457,7 @@ static void adc_worker(FAR void *arg)
/* Perform the data received callback */
DEBUGASSERT(priv->cb->au_receive != NULL);
priv->cb->au_receive(&g_adcdev, priv->channel, *(int32_t *)buf);
priv->cb->au_receive(&g_adcdev, priv->channel, *(FAR int32_t *)buf);
}
/* Re-enable ADC interrupts */
@ -473,7 +473,7 @@ static void adc_worker(FAR void *arg)
*
****************************************************************************/
static int adc_interrupt(int irq, void *context, FAR void *arg)
static int adc_interrupt(int irq, FAR void *context, FAR void *arg)
{
FAR struct ads1255_dev_s *priv =
(FAR struct ads1255_dev_s *)g_adcdev.ad_priv;

View File

@ -236,7 +236,7 @@ static int ads7828_readchannel(FAR struct ads7828_dev_s *priv,
i2cmsg[1].flags = I2C_M_READ;
uint16_t buf;
i2cmsg[1].buffer = (uint8_t *)(&buf);
i2cmsg[1].buffer = (FAR uint8_t *)(&buf);
i2cmsg[1].length = sizeof(buf);
ret = I2C_TRANSFER(priv->i2c, i2cmsg, 2);
if (ret < 0)

View File

@ -336,7 +336,7 @@ static int hx711_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case HX711_GET_AVERAGE:
{
unsigned *ptr = (unsigned *)((uintptr_t)arg);
FAR unsigned *ptr = (FAR unsigned *)((uintptr_t)arg);
if (ptr == NULL)
{
ret = -EINVAL;
@ -349,7 +349,7 @@ static int hx711_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case HX711_GET_CHANNEL:
{
char *ptr = (char *)((uintptr_t)arg);
FAR char *ptr = (FAR char *)((uintptr_t)arg);
if (ptr == NULL)
{
ret = -EINVAL;
@ -362,7 +362,7 @@ static int hx711_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case HX711_GET_GAIN:
{
unsigned char *ptr = (unsigned char *)((uintptr_t)arg);
FAR unsigned char *ptr = (FAR unsigned char *)((uintptr_t)arg);
if (ptr == NULL)
{
ret = -EINVAL;
@ -375,7 +375,7 @@ static int hx711_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case HX711_GET_VAL_PER_UNIT:
{
unsigned *ptr = (unsigned *)((uintptr_t)arg);
FAR unsigned *ptr = (FAR unsigned *)((uintptr_t)arg);
if (ptr == NULL)
{
ret = -EINVAL;
@ -388,7 +388,7 @@ static int hx711_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case HX711_TARE:
{
float *precision = (float *)((uintptr_t)arg);
FAR float *precision = (FAR float *)((uintptr_t)arg);
if (precision == NULL)
{
ret = -EINVAL;
@ -401,7 +401,7 @@ static int hx711_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case HX711_SET_SIGN:
{
int *sign = (int *)((uintptr_t)arg);
FAR int *sign = (FAR int *)((uintptr_t)arg);
if (sign == NULL || (*sign != 1 && *sign != -1))
{
ret = EINVAL;

View File

@ -267,7 +267,7 @@ static int max1161x_readchannel(FAR struct max1161x_dev_s *priv,
i2cmsg[2].flags = I2C_M_READ;
uint16_t buf;
i2cmsg[2].buffer = (uint8_t *)(&buf);
i2cmsg[2].buffer = (FAR uint8_t *)(&buf);
i2cmsg[2].length = sizeof(buf);
ret = I2C_TRANSFER(priv->i2c, i2cmsg, 3);
if (ret < 0)

View File

@ -585,9 +585,9 @@ struct audio_lowerhalf_s *audio_dma_initialize(struct dma_dev_s *dma_dev,
audio_dma->fifo_width = fifo_width;
if (audio_dma->playback)
audio_dma->dst_addr = up_addrenv_va_to_pa((void *)fifo_addr);
audio_dma->dst_addr = up_addrenv_va_to_pa((FAR void *)fifo_addr);
else
audio_dma->src_addr = up_addrenv_va_to_pa((void *)fifo_addr);
audio_dma->src_addr = up_addrenv_va_to_pa((FAR void *)fifo_addr);
audio_dma->buffer_size = CONFIG_AUDIO_BUFFER_NUMBYTES;
audio_dma->buffer_num = CONFIG_AUDIO_NUM_BUFFERS;

View File

@ -38,7 +38,7 @@
struct audio_i2s_s
{
struct audio_lowerhalf_s dev;
struct i2s_dev_s *i2s;
FAR struct i2s_dev_s *i2s;
bool playback;
};
@ -91,7 +91,7 @@ static int audio_i2s_enqueuebuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct ap_buffer_s *apb);
static int audio_i2s_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd,
unsigned long arg);
static void audio_i2s_callback(struct i2s_dev_s *dev,
static void audio_i2s_callback(FAR struct i2s_dev_s *dev,
FAR struct ap_buffer_s *apb, FAR void *arg,
int result);
@ -130,7 +130,7 @@ static const struct audio_ops_s g_audio_i2s_ops =
static int audio_i2s_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
FAR struct audio_caps_s *caps)
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
/* Validate the structure */
@ -208,7 +208,7 @@ static int audio_i2s_configure(FAR struct audio_lowerhalf_s *dev,
FAR const struct audio_caps_s *caps)
#endif
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s;
int samprate;
int nchannels;
@ -257,7 +257,7 @@ static int audio_i2s_configure(FAR struct audio_lowerhalf_s *dev,
static int audio_i2s_shutdown(FAR struct audio_lowerhalf_s *dev)
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
return I2S_IOCTL(i2s, AUDIOIOC_SHUTDOWN, audio_i2s->playback);
@ -270,7 +270,7 @@ static int audio_i2s_start(FAR struct audio_lowerhalf_s *dev,
static int audio_i2s_start(FAR struct audio_lowerhalf_s *dev)
#endif
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
return I2S_IOCTL(i2s, AUDIOIOC_START, audio_i2s->playback);
@ -284,7 +284,7 @@ static int audio_i2s_stop(FAR struct audio_lowerhalf_s *dev,
static int audio_i2s_stop(FAR struct audio_lowerhalf_s *dev)
#endif
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
return I2S_IOCTL(i2s, AUDIOIOC_STOP, audio_i2s->playback);
@ -299,7 +299,7 @@ static int audio_i2s_pause(FAR struct audio_lowerhalf_s *dev,
static int audio_i2s_pause(FAR struct audio_lowerhalf_s *dev)
#endif
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
return I2S_IOCTL(i2s, AUDIOIOC_PAUSE, audio_i2s->playback);
@ -312,7 +312,7 @@ static int audio_i2s_resume(FAR struct audio_lowerhalf_s *dev,
static int audio_i2s_resume(FAR struct audio_lowerhalf_s *dev)
#endif
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
return I2S_IOCTL(i2s, AUDIOIOC_RESUME, audio_i2s->playback);
@ -322,7 +322,7 @@ static int audio_i2s_resume(FAR struct audio_lowerhalf_s *dev)
static int audio_i2s_allocbuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct audio_buf_desc_s *bufdesc)
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
return I2S_IOCTL(i2s, AUDIOIOC_ALLOCBUFFER, (unsigned long)bufdesc);
@ -331,7 +331,7 @@ static int audio_i2s_allocbuffer(FAR struct audio_lowerhalf_s *dev,
static int audio_i2s_freebuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct audio_buf_desc_s *bufdesc)
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
return I2S_IOCTL(i2s, AUDIOIOC_FREEBUFFER, (unsigned long)bufdesc);
@ -340,7 +340,7 @@ static int audio_i2s_freebuffer(FAR struct audio_lowerhalf_s *dev,
static int audio_i2s_enqueuebuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct ap_buffer_s *apb)
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
if (audio_i2s->playback)
@ -356,7 +356,7 @@ static int audio_i2s_enqueuebuffer(FAR struct audio_lowerhalf_s *dev,
static int audio_i2s_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd,
unsigned long arg)
{
FAR struct audio_i2s_s *audio_i2s = (struct audio_i2s_s *)dev;
FAR struct audio_i2s_s *audio_i2s = (FAR struct audio_i2s_s *)dev;
FAR struct i2s_dev_s *i2s = audio_i2s->i2s;
return I2S_IOCTL(i2s, cmd, arg);
@ -370,7 +370,7 @@ static int audio_i2s_reserve(FAR struct audio_lowerhalf_s *dev)
#endif
{
#ifdef CONFIG_AUDIO_MULTI_SESSION
*session = (void *)audio_i2s->playback;
*session = (FAR void *)audio_i2s->playback;
#endif
return OK;
}
@ -385,7 +385,7 @@ static int audio_i2s_release(FAR struct audio_lowerhalf_s *dev)
return OK;
}
static void audio_i2s_callback(struct i2s_dev_s *dev,
static void audio_i2s_callback(FAR struct i2s_dev_s *dev,
FAR struct ap_buffer_s *apb,
FAR void *arg, int result)
{

View File

@ -275,7 +275,7 @@ static int null_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
/* Report the Sample rates we support */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr = AUDIO_SAMP_RATE_8K |
AUDIO_SAMP_RATE_11K |
AUDIO_SAMP_RATE_16K |

View File

@ -418,7 +418,7 @@ static int cs4344_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
/* Report the Sample rates we support */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr =
AUDIO_SAMP_RATE_16K | AUDIO_SAMP_RATE_22K |
AUDIO_SAMP_RATE_32K | AUDIO_SAMP_RATE_44K |

View File

@ -582,7 +582,7 @@ static int cs43l22_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
/* Report the Sample rates we support */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr =
AUDIO_SAMP_RATE_8K | AUDIO_SAMP_RATE_11K |
AUDIO_SAMP_RATE_16K | AUDIO_SAMP_RATE_22K |

View File

@ -847,7 +847,7 @@ static int es8311_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
/* 8kHz is hardware dependent */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr =
AUDIO_SAMP_RATE_11K | AUDIO_SAMP_RATE_16K |
AUDIO_SAMP_RATE_22K | AUDIO_SAMP_RATE_32K |
@ -865,7 +865,7 @@ static int es8311_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
{
/* Report supported input sample rates */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr =
AUDIO_SAMP_RATE_11K | AUDIO_SAMP_RATE_16K |
AUDIO_SAMP_RATE_22K | AUDIO_SAMP_RATE_32K |

View File

@ -830,7 +830,7 @@ static int es8388_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
/* 8kHz is hardware dependent */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr =
AUDIO_SAMP_RATE_11K | AUDIO_SAMP_RATE_16K |
AUDIO_SAMP_RATE_22K | AUDIO_SAMP_RATE_32K |
@ -853,7 +853,7 @@ static int es8388_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
/* Report supported input sample rates */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr =
AUDIO_SAMP_RATE_11K | AUDIO_SAMP_RATE_16K |
AUDIO_SAMP_RATE_22K | AUDIO_SAMP_RATE_32K |

View File

@ -127,8 +127,8 @@ static const uint16_t g_notes_freq[84] =
/* Global variable used by the tone generator */
static const char *g_tune;
static const char *g_next;
static FAR const char *g_tune;
static FAR const char *g_next;
static uint8_t g_tempo;
static uint8_t g_note_mode;
static uint32_t g_note_length;

View File

@ -343,7 +343,8 @@ static void vs1053_writereg(FAR struct vs1053_struct_s *dev,
*
****************************************************************************/
static int vs1053_setfrequency(FAR struct vs1053_struct_s *dev, uint32_t freq)
static int vs1053_setfrequency(FAR struct vs1053_struct_s *dev,
uint32_t freq)
{
double factor;
uint16_t reg;
@ -648,7 +649,7 @@ static int vs1053_getcaps(FAR struct audio_lowerhalf_s *lower, int type,
/* Report the Sample rates we support */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr = AUDIO_SAMP_RATE_8K |
AUDIO_SAMP_RATE_11K |
AUDIO_SAMP_RATE_16K |
@ -826,6 +827,7 @@ static int vs1053_configure(FAR struct audio_lowerhalf_s *lower,
{
dev->bass = 100;
}
vs1053_setbass(dev);
break;
@ -840,6 +842,7 @@ static int vs1053_configure(FAR struct audio_lowerhalf_s *lower,
{
dev->treble = 100;
}
vs1053_setbass(dev);
break;

View File

@ -1018,7 +1018,7 @@ static int wm8904_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
/* Report the Sample rates we support */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr =
AUDIO_SAMP_RATE_8K | AUDIO_SAMP_RATE_11K |
AUDIO_SAMP_RATE_16K | AUDIO_SAMP_RATE_22K |

View File

@ -242,7 +242,7 @@ uint16_t wm8994_readreg(FAR struct wm8994_dev_s *priv, uint16_t regaddr)
msg[0].frequency = priv->lower->frequency;
msg[0].addr = priv->lower->address;
msg[0].flags = 0;
msg[0].buffer = (uint8_t *)&buffer;
msg[0].buffer = (FAR uint8_t *)&buffer;
msg[0].length = 2;
/* Followed by the read data */
@ -716,7 +716,7 @@ static int wm8994_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
/* Report the Sample rates we support */
ptr = (uint16_t *)caps->ac_controls.b;
ptr = (FAR uint16_t *)caps->ac_controls.b;
*ptr =
AUDIO_SAMP_RATE_8K | AUDIO_SAMP_RATE_11K |
AUDIO_SAMP_RATE_16K | AUDIO_SAMP_RATE_22K |

View File

@ -53,7 +53,7 @@
*
****************************************************************************/
int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
int bchlib_setup(FAR const char *blkdev, bool readonly, FAR void **handle)
{
FAR struct bchlib_s *bch;
struct geometry geo;

View File

@ -897,7 +897,7 @@ static int can_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case FIONWRITE:
{
*(uint8_t *)arg = dev->cd_xmit.tx_tail;
*(FAR uint8_t *)arg = dev->cd_xmit.tx_tail;
}
break;
@ -905,7 +905,7 @@ static int can_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case FIONREAD:
{
*(uint8_t *)arg = reader->fifo.rx_tail;
*(FAR uint8_t *)arg = reader->fifo.rx_tail;
}
break;

View File

@ -80,8 +80,8 @@ static uint32_t __clk_round_rate(FAR struct clk_s *clk, uint32_t rate);
static int __clk_enable(FAR struct clk_s *clk);
static int __clk_disable(FAR struct clk_s *clk);
static struct clk_s *__clk_lookup(FAR const char *name,
FAR struct clk_s *clk);
static FAR struct clk_s *__clk_lookup(FAR const char *name,
FAR struct clk_s *clk);
static int __clk_register(FAR struct clk_s *clk);
static void clk_disable_unused_subtree(FAR struct clk_s *clk);
@ -98,7 +98,7 @@ static ssize_t clk_procfs_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static int clk_procfs_dup(FAR const struct file *oldp,
FAR struct file *newp);
static int clk_procfs_stat(const char *relpath, struct stat *buf);
static int clk_procfs_stat(FAR const char *relpath, FAR struct stat *buf);
#endif /* !defined(CONFIG_FS_PROCFS_EXCLUDE_CLK) && defined(CONFIG_FS_PROCFS) */
@ -164,7 +164,7 @@ static int clk_procfs_close(FAR struct file *filep)
}
static size_t clk_procfs_printf(FAR char *buffer, size_t buflen,
off_t *pos, FAR const char *fmt,
FAR off_t *pos, FAR const char *fmt,
...)
{
char tmp[CLK_PROCFS_LINELEN];
@ -180,7 +180,7 @@ static size_t clk_procfs_printf(FAR char *buffer, size_t buflen,
static size_t clk_procfs_show_subtree(FAR struct clk_s *clk, int level,
FAR char *buffer, size_t buflen,
off_t *pos, FAR irqstate_t *flags)
FAR off_t *pos, FAR irqstate_t *flags)
{
FAR struct clk_s *child;
size_t oldlen = buflen;
@ -223,7 +223,7 @@ static size_t clk_procfs_show_subtree(FAR struct clk_s *clk, int level,
}
static size_t clk_procfs_showtree(FAR char *buffer,
size_t buflen, off_t *pos)
size_t buflen, FAR off_t *pos)
{
FAR struct clk_s *clk;
size_t oldlen = buflen;
@ -305,7 +305,7 @@ static int clk_procfs_dup(FAR const struct file *oldp,
return OK;
}
static int clk_procfs_stat(const char *relpath, struct stat *buf)
static int clk_procfs_stat(FAR const char *relpath, FAR struct stat *buf)
{
/* File/directory size, access block size */
@ -426,7 +426,7 @@ static void clk_calc_subtree(FAR struct clk_s *clk, uint32_t new_rate,
}
static FAR struct clk_s *clk_calc_new_rates(FAR struct clk_s *clk,
uint32_t rate)
uint32_t rate)
{
FAR struct clk_s *top = clk;
FAR struct clk_s *old_parent;
@ -561,8 +561,8 @@ static void clk_change_rate(FAR struct clk_s *clk, uint32_t best_parent_rate)
}
}
static struct clk_s *__clk_lookup(FAR const char *name,
FAR struct clk_s *clk)
static FAR struct clk_s *__clk_lookup(FAR const char *name,
FAR struct clk_s *clk)
{
FAR struct clk_s *child;
FAR struct clk_s *ret;
@ -1198,7 +1198,7 @@ FAR struct clk_s *clk_register(FAR const char *name,
size_t len;
int i;
off = len = sizeof(struct clk_s) + num_parents * sizeof(char *);
off = len = sizeof(struct clk_s) + num_parents * sizeof(FAR char *);
if (!(flags & CLK_PARENT_NAME_IS_STATIC))
{
for (i = 0; i < num_parents; i++)
@ -1228,8 +1228,8 @@ FAR struct clk_s *clk_register(FAR const char *name,
return NULL;
}
clk->name = (char *)clk + len;
strlcpy((char *)clk->name, name, size);
clk->name = (FAR char *)clk + len;
strlcpy((FAR char *)clk->name, name, size);
}
clk->ops = ops;
@ -1238,7 +1238,7 @@ FAR struct clk_s *clk_register(FAR const char *name,
if (private_data)
{
clk->private_data = (char *)clk + off;
clk->private_data = (FAR char *)clk + off;
memcpy(clk->private_data, private_data, private_size);
off += private_size;
}
@ -1251,8 +1251,9 @@ FAR struct clk_s *clk_register(FAR const char *name,
}
else
{
clk->parent_names[i] = (char *)clk + off;
strlcpy((char *)clk->parent_names[i], parent_names[i], len - off);
clk->parent_names[i] = (FAR char *)clk + off;
strlcpy((FAR char *)clk->parent_names[i], parent_names[i],
len - off);
off += strlen(parent_names[i]) + 1;
}
}

View File

@ -98,7 +98,7 @@ int mfrc522_picc_select(FAR struct mfrc522_dev_s *dev,
#if 0 /* TODO */
/* IRQ Handling */
static int mfrc522_irqhandler(FAR int irq, FAR void *context, FAR void *dev);
static int mfrc522_irqhandler(int irq, FAR void *context, FAR void *dev);
static inline int mfrc522_attachirq(FAR struct mfrc522_dev_s *dev,
xcpt_t isr);
#endif

View File

@ -96,7 +96,7 @@ int pn532_read(FAR struct pn532_dev_s *dev, FAR uint8_t *buff, uint8_t n);
#if 0 /* TODO */
/* IRQ Handling */
static int pn532_irqhandler(FAR int irq, FAR void *context, FAR void *dev);
static int pn532_irqhandler(int irq, FAR void *context, FAR void *dev);
static inline int pn532_attachirq(FAR struct pn532_dev_s *dev, xcpt_t isr);
#endif
@ -346,7 +346,7 @@ static void pn532_writecommand(FAR struct pn532_dev_s *dev, uint8_t cmd)
pn532_deselect(dev);
pn532_unlock(dev->spi);
tracetx("command sent", (uint8_t *) f, FRAME_SIZE(f));
tracetx("command sent", (FAR uint8_t *)f, FRAME_SIZE(f));
}
#endif
@ -408,7 +408,7 @@ int pn532_read_ack(FAR struct pn532_dev_s *dev)
int res = 0;
uint8_t ack[6];
pn532_read(dev, (uint8_t *) &ack, 6);
pn532_read(dev, (FAR uint8_t *) &ack, 6);
if (memcmp(&ack, &pn532ack, 6) == 0x00)
{
@ -453,7 +453,7 @@ int pn532_write_frame(FAR struct pn532_dev_s *dev, FAR struct pn532_frame *f)
SPI_SNDBLOCK(dev->spi, f, FRAME_SIZE(f));
pn532_deselect(dev);
pn532_unlock(dev->spi);
tracetx("WriteFrame", (uint8_t *) f, FRAME_SIZE(f));
tracetx("WriteFrame", (FAR uint8_t *)f, FRAME_SIZE(f));
/* Wait ACK frame */
@ -481,7 +481,7 @@ int pn532_read_frame(FAR struct pn532_dev_s *dev, FAR struct pn532_frame *f,
{
/* Read header */
pn532_read(dev, (uint8_t *) f, sizeof(struct pn532_frame));
pn532_read(dev, (FAR uint8_t *)f, sizeof(struct pn532_frame));
if (pn532_rx_frame_is_valid(f, false))
{
if (max_size < f->len)
@ -521,7 +521,7 @@ bool pn532_set_config(FAR struct pn532_dev_s *dev, uint8_t flags)
if (pn532_write_frame(dev, f) == OK)
{
pn532_read(dev, (uint8_t *) &resp, 9);
pn532_read(dev, (FAR uint8_t *)&resp, 9);
tracerx("set config response", resp, 9);
res = true;
}
@ -555,7 +555,7 @@ int pn532_sam_config(FAR struct pn532_dev_s *dev,
{
if (pn532_read_frame(dev, f, 4) == OK)
{
tracerx("sam config response", (uint8_t *) f->data, 3);
tracerx("sam config response", (FAR uint8_t *)f->data, 3);
if (f->data[0] == PN532_COMMAND_SAMCONFIGURATION + 1)
{
res = OK;
@ -798,8 +798,8 @@ bool pn532_set_rf_config(struct pn532_dev_s * dev,
if (pn532_write_frame(dev, f) == OK)
{
pn532_read(dev, (uint8_t *) f, 10);
tracerx("rf config response", (uint8_t *) f, 10);
pn532_read(dev, (FAR uint8_t *)f, 10);
tracerx("rf config response", (FAR uint8_t *)f, 10);
if (pn532_rx_frame_is_valid(f, true))
{
if (f->data[0] == PN532_COMMAND_RFCONFIGURATION + 1)
@ -990,7 +990,7 @@ static int _ioctl(FAR struct file *filep, int cmd, unsigned long arg)
}
ret = pn532_read_passive_data(dev, tag_data->address,
(uint8_t *) &tag_data->data,
(FAR uint8_t *)&tag_data->data,
sizeof(tag_data->data));
dev->state = PN532_STATE_IDLE;

View File

@ -182,7 +182,7 @@ static ssize_t devurand_read(FAR struct file *filep, FAR char *buffer,
while (n >= 4)
{
*(uint32_t *)buffer = PRNG();
*(FAR uint32_t *)buffer = PRNG();
buffer += 4;
n -= 4;
}

View File

@ -80,7 +80,7 @@ int fdt_get_irq(FAR const void *fdt, int nodeoffset,
}
int fdt_get_irq_by_path(FAR const void *fdt, int offset,
const char *path, int irqbase)
FAR const char *path, int irqbase)
{
return fdt_get_irq(fdt, fdt_path_offset(fdt, path), offset, irqbase);
}
@ -124,7 +124,7 @@ uintptr_t fdt_ld_by_cells(FAR const void *value, int cells)
}
uintptr_t fdt_get_reg_base_by_name(FAR const void *fdt, int offset,
const char *reg_name)
FAR const char *reg_name)
{
uintptr_t addr = 0;
@ -184,7 +184,7 @@ uintptr_t fdt_get_reg_base_by_path(FAR const void *fdt, FAR const char *path)
bool fdt_device_is_available(FAR const void *fdt, int node)
{
const char *status = fdt_getprop(fdt, node, "status", NULL);
FAR const char *status = fdt_getprop(fdt, node, "status", NULL);
if (!status)
{
return true;
@ -198,7 +198,7 @@ bool fdt_device_is_available(FAR const void *fdt, int node)
return false;
}
const char *fdt_get_node_label(FAR const void *fdt, int node)
FAR const char *fdt_get_node_label(FAR const void *fdt, int node)
{
int symbols_offset;
int property_offset;

View File

@ -121,23 +121,23 @@ struct ee24xx_dev_s
{
/* Bus management */
struct i2c_master_s *i2c; /* I2C device where the EEPROM is attached */
uint32_t freq; /* I2C bus speed */
uint8_t addr; /* 7-bit unshifted I2C device address */
FAR struct i2c_master_s *i2c; /* I2C device where the EEPROM is attached */
uint32_t freq; /* I2C bus speed */
uint8_t addr; /* 7-bit unshifted I2C device address */
/* Driver management */
mutex_t lock; /* file write access serialization */
uint8_t refs; /* Nr of times the device has been opened */
bool readonly; /* Flags */
mutex_t lock; /* file write access serialization */
uint8_t refs; /* Nr of times the device has been opened */
bool readonly; /* Flags */
/* Expanded from geometry */
uint32_t size; /* total bytes in device */
uint16_t pgsize; /* write block size, in bytes */
uint16_t addrlen; /* number of bytes in data addresses */
uint16_t haddrbits; /* Number of bits in high address part */
uint16_t haddrshift; /* bit-shift of high address part */
uint32_t size; /* total bytes in device */
uint16_t pgsize; /* write block size, in bytes */
uint16_t addrlen; /* number of bytes in data addresses */
uint16_t haddrbits; /* Number of bits in high address part */
uint16_t haddrshift; /* bit-shift of high address part */
};
/****************************************************************************
@ -322,7 +322,7 @@ static int ee24xx_writepage(FAR struct ee24xx_dev_s *eedev, uint32_t memaddr,
msgs[1].frequency = msgs[0].frequency;
msgs[1].addr = msgs[0].addr;
msgs[1].flags = I2C_M_NOSTART;
msgs[1].buffer = (uint8_t *)buffer;
msgs[1].buffer = (FAR uint8_t *)buffer;
msgs[1].length = len;
return I2C_TRANSFER(eedev->i2c, msgs, 2);
@ -543,7 +543,7 @@ static ssize_t ee24xx_read(FAR struct file *filep, FAR char *buffer,
msgs[1].frequency = msgs[0].frequency;
msgs[1].addr = msgs[0].addr;
msgs[1].flags = I2C_M_READ;
msgs[1].buffer = (uint8_t *)buffer;
msgs[1].buffer = (FAR uint8_t *)buffer;
msgs[1].length = len;
ret = I2C_TRANSFER(eedev->i2c, msgs, 2);
@ -618,7 +618,7 @@ static ssize_t at24cs_read_uuid(FAR struct file *filep, FAR char *buffer,
msgs[1].frequency = msgs[0].frequency;
msgs[1].addr = msgs[0].addr;
msgs[1].flags = I2C_M_READ;
msgs[1].buffer = (uint8_t *)buffer;
msgs[1].buffer = (FAR uint8_t *)buffer;
msgs[1].length = len;
ret = I2C_TRANSFER(eedev->i2c, msgs, 2);

View File

@ -324,7 +324,7 @@ static inline void ee25xx_unlock(FAR struct spi_dev_s *dev)
* Name: ee25xx_sendcmd
*
* Description: Send command and address as one transaction to take advantage
* of possible faster DMA transfers. Sending byte per byte is FAR FAR slower.
* of possible faster DMA transfers. Sending byte per byte is far far slower.
*
****************************************************************************/

View File

@ -426,7 +426,7 @@ static int i2c_slave_poll(FAR struct file *filep, FAR struct pollfd *fds,
}
else if (fds->priv != NULL)
{
struct pollfd **slot = fds->priv;
FAR struct pollfd **slot = fds->priv;
*slot = NULL;
fds->priv = NULL;
}

View File

@ -105,7 +105,7 @@ static ssize_t ads7843e_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static int ads7843e_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
static int ads7843e_poll(FAR struct file *filep, struct pollfd *fds,
static int ads7843e_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
/****************************************************************************
@ -1050,7 +1050,7 @@ static int ads7843e_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
FAR struct pollfd **slot = (FAR struct pollfd **)fds->priv;
DEBUGASSERT(slot != NULL);
/* Remove all memory of the poll setup */

View File

@ -149,7 +149,7 @@ struct ads7843e_dev_s
* retained in the f_priv field of the 'struct file'.
*/
struct pollfd *fds[CONFIG_ADS7843E_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_ADS7843E_NPOLLWAITERS];
};
/****************************************************************************

View File

@ -184,19 +184,19 @@ struct mbr3108_dev_s
{
/* I2C bus and address for device. */
struct i2c_master_s *i2c;
FAR struct i2c_master_s *i2c;
uint8_t addr;
/* Configuration for device. */
struct mbr3108_board_s *board;
const struct mbr3108_sensor_conf_s *sensor_conf;
FAR struct mbr3108_board_s *board;
FAR const struct mbr3108_sensor_conf_s *sensor_conf;
mutex_t devlock;
uint8_t cref;
struct mbr3108_debug_conf_s debug_conf;
bool int_pending;
struct pollfd *fds[CONFIG_INPUT_CYPRESS_MBR3108_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_INPUT_CYPRESS_MBR3108_NPOLLWAITERS];
};
/****************************************************************************
@ -234,7 +234,7 @@ static const struct file_operations g_mbr3108_fileops =
****************************************************************************/
static int mbr3108_i2c_write(FAR struct mbr3108_dev_s *dev, uint8_t reg,
const uint8_t *buf, size_t buflen)
FAR const uint8_t *buf, size_t buflen)
{
struct i2c_msg_s msgv[2] =
{
@ -282,7 +282,7 @@ static int mbr3108_i2c_write(FAR struct mbr3108_dev_s *dev, uint8_t reg,
}
static int mbr3108_i2c_read(FAR struct mbr3108_dev_s *dev, uint8_t reg,
uint8_t *buf, size_t buflen)
FAR uint8_t *buf, size_t buflen)
{
struct i2c_msg_s msgv[2] =
{
@ -1075,13 +1075,14 @@ static int mbr3108_isr_handler(int irq, FAR void *context, FAR void *arg)
* Public Functions
****************************************************************************/
int cypress_mbr3108_register(FAR const char *devpath,
FAR struct i2c_master_s *i2c_dev,
uint8_t i2c_devaddr,
struct mbr3108_board_s *board_config,
const struct mbr3108_sensor_conf_s *sensor_conf)
int
cypress_mbr3108_register(FAR const char *devpath,
FAR struct i2c_master_s *i2c_dev,
uint8_t i2c_devaddr,
FAR struct mbr3108_board_s *board_config,
FAR const struct mbr3108_sensor_conf_s *sensor_conf)
{
struct mbr3108_dev_s *priv;
FAR struct mbr3108_dev_s *priv;
int ret = 0;
/* Allocate device private structure. */

View File

@ -130,7 +130,7 @@ struct ft5x06_dev_s
* retained in the f_priv field of the 'struct file'.
*/
struct pollfd *fds[CONFIG_FT5X06_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_FT5X06_NPOLLWAITERS];
};
/****************************************************************************
@ -159,7 +159,7 @@ static ssize_t ft5x06_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static int ft5x06_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
static int ft5x06_poll(FAR struct file *filep, struct pollfd *fds,
static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
/****************************************************************************
@ -1029,7 +1029,7 @@ static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
FAR struct pollfd **slot = (FAR struct pollfd **)fds->priv;
DEBUGASSERT(slot != NULL);
/* Remove all memory of the poll setup */

View File

@ -40,11 +40,11 @@
****************************************************************************/
#ifndef putreg32
#define putreg32(v, x) (*(volatile uint32_t *)(x) = (v))
#define putreg32(v, x) (*(FAR volatile uint32_t *)(x) = (v))
#endif
#ifndef getreg32
#define getreg32(x) (*(uint32_t *)(x))
#define getreg32(x) (*(FAR volatile uint32_t *)(x))
#endif
/****************************************************************************

View File

@ -76,12 +76,12 @@ struct gt9xx_dev_s
{
/* I2C bus and address for device */
struct i2c_master_s *i2c;
FAR struct i2c_master_s *i2c;
uint8_t addr;
/* Callback for Board-Specific Operations */
const struct gt9xx_board_s *board;
FAR const struct gt9xx_board_s *board;
/* Device State */
@ -94,7 +94,7 @@ struct gt9xx_dev_s
/* Poll Waiters for device */
struct pollfd *fds[CONFIG_INPUT_GT9XX_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_INPUT_GT9XX_NPOLLWAITERS];
};
/****************************************************************************

View File

@ -98,7 +98,7 @@ static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static int max11802_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
static int max11802_poll(FAR struct file *filep, struct pollfd *fds,
static int max11802_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
/****************************************************************************
@ -1043,7 +1043,7 @@ static int max11802_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
FAR struct pollfd **slot = (FAR struct pollfd **)fds->priv;
DEBUGASSERT(slot != NULL);
/* Remove all memory of the poll setup */

View File

@ -135,7 +135,7 @@ struct max11802_dev_s
* retained in the f_priv field of the 'struct file'.
*/
struct pollfd *fds[CONFIG_MAX11802_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_MAX11802_NPOLLWAITERS];
};
/****************************************************************************

View File

@ -202,7 +202,7 @@ struct mxt_dev_s
* retained in the f_priv field of the 'struct file'.
*/
struct pollfd *fds[CONFIG_MXT_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_MXT_NPOLLWAITERS];
};
/****************************************************************************
@ -226,7 +226,7 @@ static int mxt_putobject(FAR struct mxt_dev_s *priv, uint8_t type,
uint8_t offset, uint8_t value);
#if 0 /* Not used */
static int mxt_getobject(FAR struct mxt_dev_s *priv, uint8_t type,
uint8_t offset, FAR uint8_t *value);
uint8_t offset, FAR uint8_t *value);
#endif
static int mxt_flushmsgs(FAR struct mxt_dev_s *priv);
@ -258,11 +258,12 @@ static int mxt_close(FAR struct file *filep);
static ssize_t mxt_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static int mxt_poll(FAR struct file *filep, struct pollfd *fds, bool setup);
static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
/* Initialization */
static int mxt_getinfo(struct mxt_dev_s *priv);
static int mxt_getinfo(FAR struct mxt_dev_s *priv);
static int mxt_getobjtab(FAR struct mxt_dev_s *priv);
static int mxt_hwinitialize(FAR struct mxt_dev_s *priv);
@ -1509,7 +1510,7 @@ static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
****************************************************************************/
static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
bool setup)
{
FAR struct inode *inode;
FAR struct mxt_dev_s *priv;
@ -1580,7 +1581,7 @@ static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
FAR struct pollfd **slot = (FAR struct pollfd **)fds->priv;
DEBUGASSERT(slot != NULL);
/* Remove all memory of the poll setup */
@ -1598,7 +1599,7 @@ errout:
* Name: mxt_getinfo
****************************************************************************/
static int mxt_getinfo(struct mxt_dev_s *priv)
static int mxt_getinfo(FAR struct mxt_dev_s *priv)
{
int ret;

View File

@ -192,7 +192,7 @@ struct spq10kbd_dev_s
* retained in the f_priv field of the 'struct file'.
*/
struct pollfd *fds[CONFIG_SPQ10KBD_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_SPQ10KBD_NPOLLWAITERS];
/* Buffer used to collect and buffer incoming keyboard characters */
@ -658,7 +658,7 @@ static int spq10kbd_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
FAR struct pollfd **slot = (FAR struct pollfd **)fds->priv;
DEBUGASSERT(slot);
/* Remove all memory of the poll setup */

View File

@ -157,7 +157,7 @@ struct stmpe811_dev_s
* retained in the f_priv field of the 'struct file'.
*/
struct pollfd *fds[CONFIG_STMPE811_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_STMPE811_NPOLLWAITERS];
#endif
/* Fields that may be disabled to save size of GPIO support is not used */

View File

@ -103,7 +103,7 @@ static ssize_t stmpe811_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static int stmpe811_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
static int stmpe811_poll(FAR struct file *filep, struct pollfd *fds,
static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
/* Initialization logic */
@ -693,7 +693,7 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
FAR struct pollfd **slot = (FAR struct pollfd **)fds->priv;
DEBUGASSERT(slot != NULL);
/* Remove all memory of the poll setup */

View File

@ -323,7 +323,8 @@ static int touch_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* Name: touch_poll
****************************************************************************/
static int touch_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
static int touch_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
FAR struct touch_openpriv_s *openpriv = filep->f_priv;
pollevent_t eventset = 0;

View File

@ -166,7 +166,7 @@ struct tsc2007_dev_s
* retained in the f_priv field of the 'struct file'.
*/
struct pollfd *fds[CONFIG_TSC2007_NPOLLWAITERS];
FAR struct pollfd *fds[CONFIG_TSC2007_NPOLLWAITERS];
};
/****************************************************************************
@ -192,7 +192,7 @@ static int tsc2007_close(FAR struct file *filep);
static ssize_t tsc2007_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static int tsc2007_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static int tsc2007_poll(FAR struct file *filep, struct pollfd *fds,
static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
/****************************************************************************
@ -1136,7 +1136,7 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
FAR struct pollfd **slot = (FAR struct pollfd **)fds->priv;
DEBUGASSERT(slot != NULL);
/* Remove all memory of the poll setup */

View File

@ -996,7 +996,7 @@ static int icjx_interrupt(int irq, FAR void *context, FAR void *arg)
DEBUGASSERT(work_available(&priv->work));
DEBUGVERIFY(work_queue(HPWORK, &priv->work, icjx_interrupt_worker,
(void *)priv, 0));
(FAR void *)priv, 0));
return OK;
}

View File

@ -402,7 +402,7 @@ static int ioe_rpmsg_option_handler(FAR struct rpmsg_endpoint *ept,
FAR struct ioe_rpmsg_server_s *priv = priv_;
msg->header.result = IOEXP_SETOPTION(priv->ioe, msg->pin, msg->opt,
(void *)(uintptr_t)msg->val);
(FAR void *)(uintptr_t)msg->val);
return rpmsg_send(ept, msg, len);
}

View File

@ -372,11 +372,11 @@ static inline void apa102_refresh(FAR struct apa102_dev_s *priv)
for (i = 0; i < (APA102_XRES * APA102_YRES); i++)
{
uint32_t *led = (uint32_t *) &priv->fb[i];
uint32_t *led = (FAR uint32_t *)&priv->fb[i];
/* Then transfer 4 bytes per LED */
apa102_write32(priv, (uint32_t) (*led | APA102_HEADER_FRAME));
apa102_write32(priv, (uint32_t)(*led | APA102_HEADER_FRAME));
}
/* Send an end of frame */
@ -438,7 +438,7 @@ static int apa102_putrun(FAR struct lcd_dev_s *dev, fb_coord_t row,
for (i = 0; i < pixlen; i++)
{
uint16_t *ptr = (uint16_t *)buffer;
FAR uint16_t *ptr = (FAR uint16_t *)buffer;
if (row % 2 == 0)
{
@ -568,7 +568,7 @@ static int apa102_getrun(FAR struct lcd_dev_s *dev, fb_coord_t row,
for (i = 0; i < pixlen; i++)
{
uint16_t *ptr = (uint16_t *) buffer;
FAR uint16_t *ptr = (FAR uint16_t *)buffer;
*ptr++ = apa102_rgb565(priv->fb[(row * APA102_XRES) + col + i]);
}

View File

@ -263,7 +263,7 @@ static struct jd9851_dev_s g_lcddev;
*
****************************************************************************/
static void jd9851_select(FAR FAR struct spi_dev_s *spi, int bits)
static void jd9851_select(FAR struct spi_dev_s *spi, int bits)
{
/* Select JD9851 chip (locking the SPI bus in case there are multiple
* devices competing for the SPI bus
@ -297,7 +297,7 @@ static void jd9851_select(FAR FAR struct spi_dev_s *spi, int bits)
*
****************************************************************************/
static void jd9851_deselect(FAR FAR struct spi_dev_s *spi)
static void jd9851_deselect(FAR struct spi_dev_s *spi)
{
/* De-select JD9851 chip and relinquish the SPI bus. */
@ -886,7 +886,7 @@ static int jd9851_setcontrast(FAR struct lcd_dev_s *dev,
*
****************************************************************************/
FAR struct lcd_dev_s *jd9851_lcdinitialize(FAR FAR struct spi_dev_s *spi)
FAR struct lcd_dev_s *jd9851_lcdinitialize(FAR struct spi_dev_s *spi)
{
FAR struct jd9851_dev_s *priv = &g_lcddev;

View File

@ -105,7 +105,7 @@ static int lcdfb_setcursor(FAR struct fb_vtable_s *vtable,
FAR struct fb_setcursor_s *settings);
#endif
static int lcdfb_setpower(FAR struct fb_vtable_s *vtable, FAR int power);
static int lcdfb_setpower(FAR struct fb_vtable_s *vtable, int power);
/****************************************************************************
* Private Data
@ -467,7 +467,7 @@ static int lcdfb_setcursor(FAR struct fb_vtable_s *vtable,
* Name: lcdfb_setpower
****************************************************************************/
static int lcdfb_setpower(FAR struct fb_vtable_s *vtable, FAR int power)
static int lcdfb_setpower(FAR struct fb_vtable_s *vtable, int power)
{
int ret = -EINVAL;
FAR struct lcdfb_dev_s *priv;

View File

@ -132,7 +132,7 @@ static const struct lcd_planeinfo_s g_planeinfo =
#ifndef CONFIG_LCD_NOGETRUN
.getrun = lpm013m091a_getrun, /* Get a run from lcd memory */
#endif
.buffer = (uint8_t *) g_runbuffer, /* Run scratch buffer */
.buffer = (FAR uint8_t *)g_runbuffer, /* Run scratch buffer */
.bpp = LPM013M091A_BPP, /* Bits-per-pixel */
};

View File

@ -283,21 +283,21 @@ static struct max7219_dev_s g_max7219dev =
*
****************************************************************************/
static inline void __set_bit(int nr, uint8_t * addr)
static inline void __set_bit(int nr, uint8_t *addr)
{
uint8_t mask = BIT_BYTE_MASK(nr);
uint8_t *p = ((uint8_t *) addr) + BIT_BYTE(nr);
uint8_t *p = ((FAR uint8_t *)addr) + BIT_BYTE(nr);
*p |= mask;
}
static inline void __clear_bit(int nr, uint8_t * addr)
static inline void __clear_bit(int nr, uint8_t *addr)
{
uint8_t mask = BIT_BYTE_MASK(nr);
uint8_t *p = ((uint8_t *) addr) + BIT_BYTE(nr);
uint8_t *p = ((FAR uint8_t *)addr) + BIT_BYTE(nr);
*p &= ~mask;
}
static inline int __test_bit(int nr, const volatile uint8_t * addr)
static inline int __test_bit(int nr, const volatile uint8_t *addr)
{
return 1 & (addr[BIT_BYTE(nr)] >> (nr & (BITS_PER_BYTE - 1)));
}

View File

@ -200,10 +200,10 @@ static const struct fb_videoinfo_s g_videoinfo =
static const struct lcd_planeinfo_s g_planeinfo =
{
.putrun = memlcd_putrun, /* Put a run into lcd memory */
.getrun = memlcd_getrun, /* Get a run from lcd memory */
.buffer = (uint8_t *) g_runbuffer, /* Run scratch buffer */
.bpp = MEMLCD_BPP, /* Bits-per-pixel */
.putrun = memlcd_putrun, /* Put a run into lcd memory */
.getrun = memlcd_getrun, /* Get a run from lcd memory */
.buffer = (FAR uint8_t *)g_runbuffer, /* Run scratch buffer */
.bpp = MEMLCD_BPP, /* Bits-per-pixel */
};
/* This is the oled driver instance (only a single device is supported
@ -244,21 +244,21 @@ static struct memlcd_dev_s g_memlcddev =
*
****************************************************************************/
static inline void __set_bit(int nr, uint8_t * addr)
static inline void __set_bit(int nr, uint8_t *addr)
{
uint8_t mask = BIT_BYTE_MASK(nr);
uint8_t *p = ((uint8_t *) addr) + BIT_BYTE(nr);
uint8_t *p = ((FAR uint8_t *)addr) + BIT_BYTE(nr);
*p |= mask;
}
static inline void __clear_bit(int nr, uint8_t * addr)
static inline void __clear_bit(int nr, uint8_t *addr)
{
uint8_t mask = BIT_BYTE_MASK(nr);
uint8_t *p = ((uint8_t *) addr) + BIT_BYTE(nr);
uint8_t *p = ((FAR uint8_t *)addr) + BIT_BYTE(nr);
*p &= ~mask;
}
static inline int __test_bit(int nr, const volatile uint8_t * addr)
static inline int __test_bit(int nr, const volatile uint8_t *addr)
{
return 1 & (addr[BIT_BYTE(nr)] >> (nr & (BITS_PER_BYTE - 1)));
}

View File

@ -825,7 +825,7 @@ static int ssd1351_getplaneinfo(FAR struct lcd_dev_s *dev,
pinfo->putrun = ssd1351_putrun;
pinfo->getrun = ssd1351_getrun;
pinfo->buffer = (uint8_t *)priv->runbuffer;
pinfo->buffer = (FAR uint8_t *)priv->runbuffer;
pinfo->bpp = SSD1351_BPP;
pinfo->dev = dev;

View File

@ -262,10 +262,10 @@ static const struct fb_videoinfo_s g_videoinfo =
static const struct lcd_planeinfo_s g_planeinfo =
{
.putrun = st7565_putrun, /* Put a run into LCD memory */
.getrun = st7565_getrun, /* Get a run from LCD memory */
.buffer = (uint8_t *) g_runbuffer, /* Run scratch buffer */
.bpp = ST7565_BPP, /* Bits-per-pixel */
.putrun = st7565_putrun, /* Put a run into LCD memory */
.getrun = st7565_getrun, /* Get a run from LCD memory */
.buffer = (FAR uint8_t *)g_runbuffer, /* Run scratch buffer */
.bpp = ST7565_BPP, /* Bits-per-pixel */
};
/* This is the standard, NuttX LCD driver object */

View File

@ -220,7 +220,8 @@ static int rpmsgblk_read_handler(FAR struct rpmsg_endpoint *ept,
nsectors = msg->nsectors - read;
}
ret = server->bops->read(server->blknode, (unsigned char *)rsp->buf,
ret = server->bops->read(server->blknode,
(FAR unsigned char *)rsp->buf,
msg->startsector, nsectors);
rsp->header.result = ret;
rpmsg_send_nocopy(ept, rsp, (ret < 0 ? 0 : ret * msg->sectorsize) +

View File

@ -693,7 +693,7 @@ static int rpmsgdev_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
msglen, arglen > 0 ? (FAR void *)arg : NULL);
if (cmd == FIONBIO && ret >= 0)
{
int *nonblock = (FAR int *)(uintptr_t)arg;
FAR int *nonblock = (FAR int *)(uintptr_t)arg;
priv->nonblock = *nonblock;
}

View File

@ -4102,21 +4102,21 @@ static void mmcsd_hwuninitialize(FAR struct mmcsd_state_s *priv)
SDIO_RESET(priv->dev);
}
static const char *mmc_get_mode_name(uint8_t mode)
static FAR const char *mmc_get_mode_name(uint8_t mode)
{
switch (mode)
{
case EXT_CSD_HS_TIMING_BC:
return "backwards compatibility";
return "backwards compatibility";
case EXT_CSD_HS_TIMING_HS:
return "high speed";
return "high speed";
case EXT_CSD_HS_TIMING_HS200:
return "HS200";
return "HS200";
case EXT_CSD_HS_TIMING_HS400:
return "HS400";
return "HS400";
default:
ferr("Unknown mode: %u\n", mode);
return "Unknown";
ferr("Unknown mode: %u\n", mode);
return "Unknown";
}
}

View File

@ -156,46 +156,52 @@ static void mmcsd_unlock(FAR struct mmcsd_slot_s *slot);
static int mmcsd_waitready(FAR struct mmcsd_slot_s *slot);
static uint32_t mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot,
const struct mmcsd_cmdinfo_s *cmd, uint32_t arg);
FAR const struct mmcsd_cmdinfo_s *cmd,
uint32_t arg);
static void mmcsd_setblklen(FAR struct mmcsd_slot_s *slot,
uint32_t length);
static uint32_t mmcsd_nsac(FAR struct mmcsd_slot_s *slot, uint8_t *csd,
uint32_t frequency);
static uint32_t mmcsd_taac(FAR struct mmcsd_slot_s *slot, uint8_t *csd);
static void mmcsd_decodecsd(FAR struct mmcsd_slot_s *slot, uint8_t *csd);
uint32_t length);
static uint32_t mmcsd_nsac(FAR struct mmcsd_slot_s *slot, FAR uint8_t *csd,
uint32_t frequency);
static uint32_t mmcsd_taac(FAR struct mmcsd_slot_s *slot, FAR uint8_t *csd);
static void mmcsd_decodecsd(FAR struct mmcsd_slot_s *slot,
FAR uint8_t *csd);
static void mmcsd_checkwrprotect(FAR struct mmcsd_slot_s *slot,
uint8_t *csd);
FAR uint8_t *csd);
static int mmcsd_getcardinfo(FAR struct mmcsd_slot_s *slot,
uint8_t *buffer, const struct mmcsd_cmdinfo_s *cmd);
FAR uint8_t *buffer,
FAR const struct mmcsd_cmdinfo_s *cmd);
#define mmcsd_getcsd(slot, csd) mmcsd_getcardinfo(slot, csd, &g_cmd9);
#define mmcsd_getcid(slot, cid) mmcsd_getcardinfo(slot, cid, &g_cmd10);
static int mmcsd_recvblock(FAR struct mmcsd_slot_s *slot,
uint8_t *buffer, int nbytes);
FAR uint8_t *buffer, int nbytes);
#if !defined(CONFIG_MMCSD_READONLY)
static int mmcsd_xmitblock(FAR struct mmcsd_slot_s *slot,
const uint8_t *buffer, int nbytes, uint8_t token);
FAR const uint8_t *buffer, int nbytes,
uint8_t token);
#endif
/* Block driver interfaces **************************************************/
static int mmcsd_open(FAR struct inode *inode);
static int mmcsd_close(FAR struct inode *inode);
static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
blkcnt_t start_sector, unsigned int nsectors);
static ssize_t mmcsd_read(FAR struct inode *inode,
FAR unsigned char *buffer,
blkcnt_t start_sector, unsigned int nsectors);
#if !defined(CONFIG_MMCSD_READONLY)
static ssize_t mmcsd_write(FAR struct inode *inode,
const unsigned char *buffer, blkcnt_t start_sector,
unsigned int nsectors);
FAR const unsigned char *buffer,
blkcnt_t start_sector,
unsigned int nsectors);
#endif
static int mmcsd_geometry(FAR struct inode *inode,
struct geometry *geometry);
FAR struct geometry *geometry);
/* Initialization ***********************************************************/
static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot);
static void mmcsd_mediachanged(void *arg);
static void mmcsd_mediachanged(FAR void *arg);
/****************************************************************************
* Private Data
@ -659,7 +665,7 @@ static void mmcsd_setblklen(FAR struct mmcsd_slot_s *slot, uint32_t length)
*
****************************************************************************/
static uint32_t mmcsd_nsac(FAR struct mmcsd_slot_s *slot, uint8_t *csd,
static uint32_t mmcsd_nsac(FAR struct mmcsd_slot_s *slot, FAR uint8_t *csd,
uint32_t frequency)
{
/* NSAC is 8-bits wide and is in units of 100 clock cycles. Therefore,
@ -678,7 +684,7 @@ static uint32_t mmcsd_nsac(FAR struct mmcsd_slot_s *slot, uint8_t *csd,
*
****************************************************************************/
static uint32_t mmcsd_taac(FAR struct mmcsd_slot_s *slot, uint8_t *csd)
static uint32_t mmcsd_taac(FAR struct mmcsd_slot_s *slot, FAR uint8_t *csd)
{
int tundx;
@ -718,7 +724,7 @@ static uint32_t mmcsd_taac(FAR struct mmcsd_slot_s *slot, uint8_t *csd)
*
****************************************************************************/
static void mmcsd_decodecsd(FAR struct mmcsd_slot_s *slot, uint8_t *csd)
static void mmcsd_decodecsd(FAR struct mmcsd_slot_s *slot, FAR uint8_t *csd)
{
FAR struct spi_dev_s *spi = slot->spi;
uint32_t maxfrequency;
@ -879,7 +885,8 @@ static void mmcsd_decodecsd(FAR struct mmcsd_slot_s *slot, uint8_t *csd)
*
****************************************************************************/
static void mmcsd_checkwrprotect(FAR struct mmcsd_slot_s *slot, uint8_t *csd)
static void mmcsd_checkwrprotect(FAR struct mmcsd_slot_s *slot,
FAR uint8_t *csd)
{
FAR struct spi_dev_s *spi = slot->spi;
@ -911,8 +918,9 @@ static void mmcsd_checkwrprotect(FAR struct mmcsd_slot_s *slot, uint8_t *csd)
*
****************************************************************************/
static int mmcsd_getcardinfo(FAR struct mmcsd_slot_s *slot, uint8_t *buffer,
const struct mmcsd_cmdinfo_s *cmd)
static int mmcsd_getcardinfo(FAR struct mmcsd_slot_s *slot,
FAR uint8_t *buffer,
FAR const struct mmcsd_cmdinfo_s *cmd)
{
FAR struct spi_dev_s *spi = slot->spi;
uint32_t result;
@ -973,8 +981,8 @@ static int mmcsd_getcardinfo(FAR struct mmcsd_slot_s *slot, uint8_t *buffer,
*
****************************************************************************/
static int mmcsd_recvblock(FAR struct mmcsd_slot_s *slot, uint8_t *buffer,
int nbytes)
static int mmcsd_recvblock(FAR struct mmcsd_slot_s *slot,
FAR uint8_t *buffer, int nbytes)
{
FAR struct spi_dev_s *spi = slot->spi;
clock_t start;
@ -1157,7 +1165,7 @@ static int mmcsd_close(FAR struct inode *inode)
*
****************************************************************************/
static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
static ssize_t mmcsd_read(FAR struct inode *inode, FAR unsigned char *buffer,
blkcnt_t start_sector, unsigned int nsectors)
{
FAR struct mmcsd_slot_s *slot;
@ -1165,9 +1173,9 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
FAR unsigned char *restore = buffer;
int retry_count = 0;
size_t nbytes;
off_t offset;
off_t offset;
uint8_t response;
int i;
int i;
int ret;
finfo("start_sector=%" PRIuOFF " nsectors=%u\n", start_sector, nsectors);
@ -1348,7 +1356,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode,
FAR const unsigned char *restore = buffer;
int retry_count = 0;
size_t nbytes;
off_t offset;
off_t offset;
uint8_t response;
int i;
int ret;
@ -1552,7 +1560,8 @@ errout_with_lock:
*
****************************************************************************/
static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry)
static int mmcsd_geometry(FAR struct inode *inode,
FAR struct geometry *geometry)
{
FAR struct mmcsd_slot_s *slot;
FAR struct spi_dev_s *spi;
@ -1937,7 +1946,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
*
****************************************************************************/
static void mmcsd_mediachanged(void *arg)
static void mmcsd_mediachanged(FAR void *arg)
{
FAR struct mmcsd_slot_s *slot = (FAR struct mmcsd_slot_s *)arg;
FAR struct spi_dev_s *spi;

View File

@ -82,7 +82,7 @@ int32_t altcom_injectimage_pkt_compose(FAR void **arg, size_t arglen,
{
int32_t size = 0;
FAR uint8_t *sending_data = (uint8_t *)arg[0];
FAR uint8_t *sending_data = (FAR uint8_t *)arg[0];
int len = *(int *)arg[1];
bool mode = *(bool *)arg[2];

View File

@ -207,7 +207,7 @@ static void altcombs_set_cellinfo_v4(
{
m_err("cmd_cellinfo->mnc error\n");
}
else if (strlen((const char *)cmd_cellinfo->cgid) >
else if (strlen((FAR const char *)cmd_cellinfo->cgid) >
APICMD_CELLINFO_GCID_MAX)
{
m_err("cmd_cellinfo->cgid error\n");

View File

@ -169,7 +169,7 @@ int32_t altcom_sendatcmd_pkt_parse(FAR struct alt1250_dev_s *dev,
size_t arglen, FAR uint64_t *bitmap)
{
FAR char *respbuff = (FAR char *)arg[0];
FAR int respbufflen = (int)arg[1];
int respbufflen = (int)arg[1];
FAR int *resplen = (FAR int *)arg[2];
if (respbufflen < pktsz)

View File

@ -578,7 +578,7 @@ int32_t altcom_repnet_pkt_parse(FAR struct alt1250_dev_s *dev,
/* parse IPv4 DNS address */
if (*(uint32_t *)in->dnsaddrv4 != 0)
if (*(FAR uint32_t *)in->dnsaddrv4 != 0)
{
FAR struct sockaddr_in *v4addr =
(FAR struct sockaddr_in *)&dnsaddrs[0];
@ -592,10 +592,10 @@ int32_t altcom_repnet_pkt_parse(FAR struct alt1250_dev_s *dev,
/* parse IPv6 DNS address */
if (!((*(uint32_t *)&in->dnsaddrv6[0] == 0) &&
(*(uint32_t *)&in->dnsaddrv6[4] == 0) &&
(*(uint32_t *)&in->dnsaddrv6[8] == 0) &&
(*(uint32_t *)&in->dnsaddrv6[12] == 0)))
if (!((*(FAR uint32_t *)&in->dnsaddrv6[0] == 0) &&
(*(FAR uint32_t *)&in->dnsaddrv6[4] == 0) &&
(*(FAR uint32_t *)&in->dnsaddrv6[8] == 0) &&
(*(FAR uint32_t *)&in->dnsaddrv6[12] == 0)))
{
FAR struct sockaddr_in6 *v6addr =
(FAR struct sockaddr_in6 *)&dnsaddrs[*ndnsaddrs];

View File

@ -43,19 +43,19 @@
****************************************************************************/
static int32_t read_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen);
FAR void **cb_args, size_t arglen);
static int32_t write_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen);
FAR void **cb_args, size_t arglen);
static int32_t exec_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen);
FAR void **cb_args, size_t arglen);
static int32_t start_ov_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen);
FAR void **cb_args, size_t arglen);
static int32_t stop_ov_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen);
FAR void **cb_args, size_t arglen);
static int32_t fwupdate_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen);
FAR void **cb_args, size_t arglen);
static int32_t server_op_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen);
FAR void **cb_args, size_t arglen);
/****************************************************************************
* Private Types
@ -78,12 +78,12 @@ struct lwm2mstub_instance_s
struct lwm2mstub_ovcondition_s
{
uint8_t valid_mask;
unsigned int min_period;
unsigned int max_period;
double gt_cond;
double lt_cond;
double step_val;
uint8_t valid_mask;
unsigned int min_period;
unsigned int max_period;
double gt_cond;
double lt_cond;
double step_val;
};
/****************************************************************************
@ -143,9 +143,10 @@ static FAR uint8_t *skip_until(FAR uint8_t *stream, FAR char *delim)
* name: strcpy_until
****************************************************************************/
static FAR char strcpy_until(char *dst, int n, char **src, char *delim)
static FAR char strcpy_until(FAR char *dst, int n, FAR char **src,
FAR char *delim)
{
char *tmp = *src;
FAR char *tmp = *src;
if (dst)
{
@ -178,28 +179,29 @@ static FAR char strcpy_until(char *dst, int n, char **src, char *delim)
* name: parse_instance
****************************************************************************/
static FAR uint8_t *parse_instance(uint8_t *pktbuf, int *seq_no, int *srv_id,
struct lwm2mstub_instance_s *inst)
static FAR uint8_t *parse_instance(FAR uint8_t *pktbuf, FAR int *seq_no,
FAR int *srv_id,
FAR struct lwm2mstub_instance_s *inst)
{
*seq_no = atoi((char *)pktbuf); /* for seq_no */
*seq_no = atoi((FAR char *)pktbuf); /* for seq_no */
pktbuf = skip_until(pktbuf, ",");
*srv_id = atoi((char *)pktbuf); /* for srv_id */
*srv_id = atoi((FAR char *)pktbuf); /* for srv_id */
pktbuf = skip_until(pktbuf, ",");
/* Parse URI like /objid/objinst/resid */
pktbuf = skip_until(pktbuf, "/");
inst->object_id = atoi((char *)pktbuf);
inst->object_id = atoi((FAR char *)pktbuf);
pktbuf = skip_until(pktbuf, "/");
inst->object_inst = atoi((char *)pktbuf);
inst->object_inst = atoi((FAR char *)pktbuf);
pktbuf = skip_until(pktbuf, "/");
inst->res_id = atoi((char *)pktbuf);
inst->res_id = atoi((FAR char *)pktbuf);
inst->res_inst = -1;
if (skip_until(pktbuf, "/") != NULL)
{
pktbuf = skip_until(pktbuf, "/");
inst->res_inst = atoi((char *)pktbuf);
inst->res_inst = atoi((FAR char *)pktbuf);
}
pktbuf = skip_until(pktbuf, ",/\r\n");
@ -212,10 +214,10 @@ static FAR uint8_t *parse_instance(uint8_t *pktbuf, int *seq_no, int *srv_id,
****************************************************************************/
static int32_t read_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen)
FAR void **cb_args, size_t arglen)
{
parse_instance(pktbuf, (int *)&cb_args[0], (int *)&cb_args[1],
(struct lwm2mstub_instance_s *)(cb_args[2]));
parse_instance(pktbuf, (FAR int *)&cb_args[0], (FAR int *)&cb_args[1],
(FAR struct lwm2mstub_instance_s *)(cb_args[2]));
return 0;
}
@ -225,25 +227,26 @@ static int32_t read_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
****************************************************************************/
static int32_t write_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen)
FAR void **cb_args, size_t arglen)
{
if (!cb_args[3] && ((int)cb_args[5]) <= 0)
{
return -1;
}
pktbuf = parse_instance(pktbuf, (int *)&cb_args[0], (int *)&cb_args[1],
(struct lwm2mstub_instance_s *)(cb_args[2]));
pktbuf = parse_instance(pktbuf, (FAR int *)&cb_args[0],
(FAR int *)&cb_args[1],
(FAR struct lwm2mstub_instance_s *)(cb_args[2]));
if (*pktbuf == '\"')
{
pktbuf++;
}
strcpy_until((char *)cb_args[3], (int)cb_args[5], (char **)&pktbuf,
strcpy_until((FAR char *)cb_args[3], (int)cb_args[5], (FAR char **)&pktbuf,
"\",\r\n");
cb_args[4] = (void *)strlen((char *)cb_args[3]);
cb_args[4] = (FAR void *)strlen((FAR char *)cb_args[3]);
return 0;
}
@ -253,10 +256,10 @@ static int32_t write_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
****************************************************************************/
static int32_t exec_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen)
FAR void **cb_args, size_t arglen)
{
parse_instance(pktbuf, (int *)&cb_args[0], (int *)&cb_args[1],
(struct lwm2mstub_instance_s *)(cb_args[2]));
parse_instance(pktbuf, (FAR int *)&cb_args[0], (FAR int *)&cb_args[1],
(FAR struct lwm2mstub_instance_s *)(cb_args[2]));
return 0;
}
@ -265,15 +268,16 @@ static int32_t exec_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
* name: parse_observe
****************************************************************************/
static uint8_t *parse_observe(uint8_t *pktbuf, int *seq_no, int *srv_id,
int tksize, char *token,
struct lwm2mstub_instance_s *inst)
FAR static uint8_t *parse_observe(FAR uint8_t *pktbuf, FAR int *seq_no,
FAR int *srv_id, int tksize,
FAR char *token,
FAR struct lwm2mstub_instance_s *inst)
{
*seq_no = atoi((char *)pktbuf); /* for seq_no */
*seq_no = atoi((FAR char *)pktbuf); /* for seq_no */
pktbuf = skip_until(pktbuf, ",");
*srv_id = atoi((char *)pktbuf); /* for server id */
*srv_id = atoi((FAR char *)pktbuf); /* for server id */
pktbuf = skip_until(pktbuf, "\"");
strcpy_until(token, tksize, (char **)&pktbuf, "\"");
strcpy_until(token, tksize, (FAR char **)&pktbuf, "\"");
pktbuf = skip_until(pktbuf, ",");
pktbuf = skip_until(pktbuf, "/");
@ -282,16 +286,16 @@ static uint8_t *parse_observe(uint8_t *pktbuf, int *seq_no, int *srv_id,
inst->res_id = -1;
inst->res_inst = -1;
inst->object_id = atoi((char *)pktbuf);
if (strcpy_until(NULL, 0, (char **)&pktbuf, "/\",") == '/')
inst->object_id = atoi((FAR char *)pktbuf);
if (strcpy_until(NULL, 0, (FAR char **)&pktbuf, "/\",") == '/')
{
inst->object_inst = atoi((char *)pktbuf);
if (strcpy_until(NULL, 0, (char **)&pktbuf, "/\",") == '/')
inst->object_inst = atoi((FAR char *)pktbuf);
if (strcpy_until(NULL, 0, (FAR char **)&pktbuf, "/\",") == '/')
{
inst->res_id = atoi((char *)pktbuf);
if (strcpy_until(NULL, 0, (char **)&pktbuf, "/\",") == '/')
inst->res_id = atoi((FAR char *)pktbuf);
if (strcpy_until(NULL, 0, (FAR char **)&pktbuf, "/\",") == '/')
{
inst->res_inst = atoi((char *)pktbuf);
inst->res_inst = atoi((FAR char *)pktbuf);
}
}
}
@ -304,15 +308,14 @@ static uint8_t *parse_observe(uint8_t *pktbuf, int *seq_no, int *srv_id,
****************************************************************************/
static int32_t start_ov_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen)
FAR void **cb_args, size_t arglen)
{
struct lwm2mstub_ovcondition_s *cond
= (struct lwm2mstub_ovcondition_s *)cb_args[5];
FAR struct lwm2mstub_ovcondition_s *cond
= (FAR struct lwm2mstub_ovcondition_s *)cb_args[5];
parse_observe(pktbuf,
(int *)&cb_args[0], (int *)&cb_args[1],
(int)cb_args[4], (char *)cb_args[3],
(struct lwm2mstub_instance_s *)cb_args[2]);
parse_observe(pktbuf, (FAR int *)&cb_args[0], (FAR int *)&cb_args[1],
(int)cb_args[4], (FAR char *)cb_args[3],
(FAR struct lwm2mstub_instance_s *)cb_args[2]);
cond->valid_mask = 0;
@ -324,12 +327,11 @@ static int32_t start_ov_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
****************************************************************************/
static int32_t stop_ov_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen)
FAR void **cb_args, size_t arglen)
{
parse_observe(pktbuf,
(int *)&cb_args[0], (int *)&cb_args[1],
(int)cb_args[4], (char *)cb_args[3],
(struct lwm2mstub_instance_s *)cb_args[2]);
parse_observe(pktbuf, (FAR int *)&cb_args[0], (FAR int *)&cb_args[1],
(int)cb_args[4], (FAR char *)cb_args[3],
(FAR struct lwm2mstub_instance_s *)cb_args[2]);
return 0;
}
@ -339,16 +341,16 @@ static int32_t stop_ov_request_hndl(FAR uint8_t *pktbuf, size_t pktsz,
****************************************************************************/
static int32_t fwupdate_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz,
FAR void **cb_args, size_t arglen)
FAR void **cb_args, size_t arglen)
{
uint8_t *ep;
FAR uint8_t *ep;
FAR int *event = (FAR int *)&cb_args[0];
/* Expected unsolicited event
* %LWM2MEV: <event>[,....
*/
*event = strtol((const char *)pktbuf, (char **)&ep, 10);
*event = strtol((FAR const char *)pktbuf, (FAR char **)&ep, 10);
if ((*event == 0) && (pktbuf == ep))
{
return -1;
@ -451,11 +453,12 @@ static int32_t server_op_notice_hndl(FAR uint8_t *pktbuf, size_t pktsz,
* name: lwm2mstub_get_handler
****************************************************************************/
lwm2mstub_hndl_t lwm2mstub_get_handler(FAR uint8_t **pktbuf, size_t *pktsz,
uint32_t *lcmdid)
lwm2mstub_hndl_t lwm2mstub_get_handler(FAR uint8_t **pktbuf,
FAR size_t *pktsz,
FAR uint32_t *lcmdid)
{
char *head_pos;
struct urc_hdltbl_s *tbl;
FAR char *head_pos;
FAR struct urc_hdltbl_s *tbl;
size_t shift_size = 0;
*lcmdid = 0;
@ -463,10 +466,10 @@ lwm2mstub_hndl_t lwm2mstub_get_handler(FAR uint8_t **pktbuf, size_t *pktsz,
while (tbl->head)
{
head_pos = strstr((char *)*pktbuf, tbl->head);
head_pos = strstr((FAR char *)*pktbuf, tbl->head);
if (head_pos)
{
shift_size = head_pos - (char *)*pktbuf + strlen(tbl->head);
shift_size = head_pos - (FAR char *)*pktbuf + strlen(tbl->head);
/* Follow shift_size to advance them */

Some files were not shown because too many files have changed in this diff Show More