From 5433ec589b0cd5aea0aa5e36d6644ce16e3b96a4 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 3 Dec 2018 17:54:21 -0600 Subject: [PATCH] fs/driver/fs_blockpartition.c: Fix void pointer warning. libs/libc/unistd/lib_daemon.c: Fix compiler error is streams disabled. sched/irq/irq_procfs.c: Fix warning sched/task/task_vfork.c: Fix void * math warning --- fs/driver/fs_blockpartition.c | 2 +- libs/libc/unistd/lib_daemon.c | 3 ++- sched/irq/irq_procfs.c | 3 ++- sched/task/task_vfork.c | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/driver/fs_blockpartition.c b/fs/driver/fs_blockpartition.c index 33f736c82a..5058177d3c 100644 --- a/fs/driver/fs_blockpartition.c +++ b/fs/driver/fs_blockpartition.c @@ -253,7 +253,7 @@ static int part_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) ret = parent->u.i_bops->geometry(parent, &geo); if (ret >= 0) { - *base += dev->firstsector * geo.geo_sectorsize; + *(FAR uint8_t *)base += dev->firstsector * geo.geo_sectorsize; } } else if (cmd == MTDIOC_GEOMETRY) diff --git a/libs/libc/unistd/lib_daemon.c b/libs/libc/unistd/lib_daemon.c index 4aead018c8..f39ef03449 100644 --- a/libs/libc/unistd/lib_daemon.c +++ b/libs/libc/unistd/lib_daemon.c @@ -133,12 +133,13 @@ int daemon(int nochdir, int noclose) return -1; } +#if CONFIG_NFILE_STREAMS > 0 /* Make sure the stdin, stdout, and stderr are closed */ (void)fclose(stdin); (void)fclose(stdout); (void)fclose(stderr); - +#endif /* Dup the fd to create standard fd 0-2 */ (void)dup2(fd, 0); diff --git a/sched/irq/irq_procfs.c b/sched/irq/irq_procfs.c index a108d25855..0ef7284017 100644 --- a/sched/irq/irq_procfs.c +++ b/sched/irq/irq_procfs.c @@ -252,7 +252,8 @@ static int irq_callback(int irq, FAR struct irq_info_s *info, (unsigned int)irq, (unsigned long)((uintptr_t)copy.handler), (unsigned long)((uintptr_t)copy.arg), - count, intpart, fracpart, copy.time / 1000); + count, intpart, fracpart, + (unsigned long)copy.time / 1000); copysize = procfs_memcpy(irqfile->line, linesize, irqfile->buffer, irqfile->remaining, &irqfile->offset); diff --git a/sched/task/task_vfork.c b/sched/task/task_vfork.c index b5d7345d8a..35c2cb4dc2 100644 --- a/sched/task/task_vfork.c +++ b/sched/task/task_vfork.c @@ -131,7 +131,8 @@ static inline int vfork_stackargsetup(FAR struct tcb_s *parent, /* Get the address correction */ - offset = child->cmn.adj_stack_ptr - parent->adj_stack_ptr; + offset = (uintptr_t)child->cmn.adj_stack_ptr - + (uintptr_t)parent->adj_stack_ptr; /* Change the child argv[] to point into its stack (instead of its * parent's stack).