Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Ralph #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions apps/examples/mount/ramdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ static struct fat_format_s g_fmt = FAT_FORMAT_INITIALIZER;

int create_ramdisk(void)
{
char *pbuffer;
uint8_t *pbuffer;
int ret;

/* Allocate a buffer to hold the file system image. */

pbuffer = (char*)malloc(BUFFER_SIZE);
pbuffer = (uint8_t*)malloc(BUFFER_SIZE);
if (!pbuffer)
{
printf("create_ramdisk: Failed to allocate ramdisk of size %d\n",
Expand Down
1 change: 0 additions & 1 deletion nuttx/arch/arm/src/stm32/stm32_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -2082,7 +2082,6 @@ int up_i2creset(FAR struct i2c_dev_s * dev)
unsigned clock_count;
unsigned stretch_count;
int ret = ERROR;
irqstate_t state;

ASSERT(dev);

Expand Down
5 changes: 1 addition & 4 deletions nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2082,10 +2082,9 @@ static void stm32_usbreset(struct stm32_usbdev_s *priv)
static inline void stm32_ep0out_testmode(FAR struct stm32_usbdev_s *priv,
uint16_t index)
{
uint32_t regval;
uint8_t testmode;

regval = stm32_getreg(STM32_OTGFS_DCTL);
(void) stm32_getreg(STM32_OTGFS_DCTL);

testmode = index >> 8;
switch (testmode)
Expand Down Expand Up @@ -4476,7 +4475,6 @@ static int stm32_ep_submit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *
static int stm32_ep_cancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req)
{
FAR struct stm32_ep_s *privep = (FAR struct stm32_ep_s *)ep;
FAR struct stm32_usbdev_s *priv;
irqstate_t flags;

#ifdef CONFIG_DEBUG
Expand All @@ -4488,7 +4486,6 @@ static int stm32_ep_cancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *
#endif

usbtrace(TRACE_EPCANCEL, privep->epphy);
priv = privep->dev;

flags = irqsave();

Expand Down
5 changes: 2 additions & 3 deletions nuttx/arch/arm/src/stm32/stm32_rtcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ static int rtc_interrupt(int irq, void *context)
int up_rtcinitialize(void)
{
uint32_t regval;
int ret;

/* Clocking for the PWR block must be provided. However, this is done
* unconditionally in stm32f40xxx_rcc.c on power up. This done unconditionally
Expand Down Expand Up @@ -626,7 +625,7 @@ int up_rtcinitialize(void)
{
/* Perform the one-time setup of the LSE clocking to the RTC */

ret = rtc_setup();
(void) rtc_setup();

/* Remember that the RTC is initialized */

Expand All @@ -636,7 +635,7 @@ int up_rtcinitialize(void)
{
/* RTC already set-up, just resume normal operation */

ret = rtc_resume();
(void) rtc_resume();

rtc_dumpregs("Did resume");
}
Expand Down
1 change: 0 additions & 1 deletion nuttx/arch/arm/src/stm32/stm32_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,6 @@ static int stm32_dmasendsetup(FAR struct sdio_dev_s *dev,
{
struct stm32_dev_s *priv = (struct stm32_dev_s *)dev;
uint32_t dblocksize;
int ret = -EINVAL;

DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0);
DEBUGASSERT(stm32_dmapreflight(dev, buffer, buflen) == 0);
Expand Down
6 changes: 6 additions & 0 deletions nuttx/arch/arm/src/stm32/stm32_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,9 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
{
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
#ifdef CONFIG_DEBUG_SPI
uint32_t regval;
#endif
uint16_t ret;

DEBUGASSERT(priv && priv->spibase);
Expand All @@ -1249,7 +1251,11 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)

/* Check and clear any error flags (Reading from the SR clears the error flags) */

#ifdef CONFIG_DEBUG_SPI
regval = spi_getreg(priv, STM32_SPI_SR_OFFSET);
#else
(void) spi_getreg(priv, STM32_SPI_SR_OFFSET);
#endif
spivdbg("Sent: %04x Return: %04x Status: %02x\n", wd, ret, regval);

return ret;
Expand Down
11 changes: 0 additions & 11 deletions nuttx/libc/stdio/lib_libdtoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
uint8_t flags, double value)
{
FAR char *digits; /* String returned by __dtoa */
FAR char *digalloc; /* Copy of digits to be freed after usage */
FAR char *rve; /* Points to the end of the return value */
int expt; /* Integer value of exponent */
int numlen; /* Actual number of digits returned by cvt */
Expand Down Expand Up @@ -188,7 +187,6 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
/* Perform the conversion */

digits = __dtoa(value, 3, prec, &expt, &dsgn, &rve);
digalloc = digits;
numlen = rve - digits;

if (IS_NEGATE(flags))
Expand Down Expand Up @@ -326,15 +324,6 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
/* Finally, print any trailing zeroes */

zeroes(obj, prec);

/* Is this memory supposed to be freed or not? */

#if 0
if (digalloc)
{
lib_free(digalloc);
}
#endif
}

/****************************************************************************
Expand Down
1 change: 1 addition & 0 deletions nuttx/libc/stdio/lib_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
****************************************************************************/

#include <stdio.h>
#include <syslog.h>
#include "lib_internal.h"

/****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion nuttx/sched/mq_timedreceive.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, void *msg, size_t msglen,
return ERROR;
}

if (!abstime || abstime->tv_sec < 0 || abstime->tv_nsec > 1000000000)
if (!abstime || abstime->tv_nsec > 1000000000)
{
set_errno(EINVAL);
return ERROR;
Expand Down
2 changes: 1 addition & 1 deletion nuttx/sched/mq_timedsend.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int mq_timedsend(mqd_t mqdes, const char *msg, size_t msglen, int prio,
return ERROR;
}

if (!abstime || abstime->tv_sec < 0 || abstime->tv_nsec > 1000000000)
if (!abstime || abstime->tv_nsec > 1000000000)
{
set_errno(EINVAL);
return ERROR;
Expand Down
2 changes: 1 addition & 1 deletion nuttx/sched/sem_timedwait.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ int sem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime)
* with a valid timeout.
*/

if (abstime->tv_sec < 0 || abstime->tv_nsec > 1000000000)
if (abstime->tv_nsec > 1000000000)
{
err = EINVAL;
goto errout_disabled;
Expand Down
8 changes: 4 additions & 4 deletions nuttx/sched/timer_settime.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
* Private Function Prototypes
********************************************************************************/

static void inline timer_sigqueue(FAR struct posix_timer_s *timer);
static void inline timer_restart(FAR struct posix_timer_s *timer, uint32_t itimer);
static inline void timer_sigqueue(FAR struct posix_timer_s *timer);
static inline void timer_restart(FAR struct posix_timer_s *timer, uint32_t itimer);
static void timer_timeout(int argc, uint32_t itimer);

/********************************************************************************
Expand All @@ -93,7 +93,7 @@ static void timer_timeout(int argc, uint32_t itimer);
*
********************************************************************************/

static void inline timer_sigqueue(FAR struct posix_timer_s *timer)
static inline void timer_sigqueue(FAR struct posix_timer_s *timer)
{
siginfo_t info;

Expand Down Expand Up @@ -133,7 +133,7 @@ static void inline timer_sigqueue(FAR struct posix_timer_s *timer)
*
********************************************************************************/

static void inline timer_restart(FAR struct posix_timer_s *timer, uint32_t itimer)
static inline void timer_restart(FAR struct posix_timer_s *timer, uint32_t itimer)
{
/* If this is a repetitive timer, then restart the watchdog */

Expand Down