This commit corrects a problem with NSH: NSH was calling the OS internal function ramdisk_register() in violation of the portable POSIX interface. This commit solves the problem by introducing a new boardctl() function BOARDIOC_MKRD which moves the RAM disk creation into the OS.

Squashed commit of the following:

    drivers/:  Run tools/nxstyle against all drivers/*.c.

    boards/boardctl.c:  Add new boardctl() command, BOARDIOC_MKRD, that can be used to create a RAM disk.  This will replace the illegal call to ramdisk_register() currently used by NSH.

    drivers/mkrd.c:  Add wrapper around ramdisk_register() for creating a proper ramdisk.
This commit is contained in:
Gregory Nutt
2019-10-26 09:35:32 -06:00
parent dae3640dc5
commit be325924fb
7 changed files with 96 additions and 18 deletions
+4 -2
View File
@@ -86,7 +86,8 @@ static const struct file_operations devnull_fops =
* Name: devnull_read
****************************************************************************/
static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer, size_t len)
static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer,
size_t len)
{
return 0; /* Return EOF */
}
@@ -95,7 +96,8 @@ static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer, size_t len
* Name: devnull_write
****************************************************************************/
static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer, size_t len)
static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
{
return len; /* Say that everything was written */
}