diff --git a/Documentation/components/drivers/character/note.rst b/Documentation/components/drivers/character/note.rst index aa0b946c93..48b2155ed6 100644 --- a/Documentation/components/drivers/character/note.rst +++ b/Documentation/components/drivers/character/note.rst @@ -237,15 +237,6 @@ Noteram Device (``/dev/note``) :return: If success, 0 (``OK``) is returned and the given overwriter mode is set as the current settings. If failed, a negated ``errno`` is returned. -.. c:macro:: NOTERAM_GETTASKNAME - - Get task name string - - :argument: A writable pointer to :c:struct:`noteram_get_taskname_s` - - :return: If success, 0 (``OK``) is returned and the task name corresponding to given pid is stored into the given pointer. - If failed, a negated ``errno`` is returned. - Filter control APIs =================== diff --git a/drivers/note/noteram_driver.c b/drivers/note/noteram_driver.c index ec7cbc9ba7..3721cf8c42 100644 --- a/drivers/note/noteram_driver.c +++ b/drivers/note/noteram_driver.c @@ -627,30 +627,6 @@ static int noteram_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } break; -#ifdef NOTERAM_GETTASKNAME - /* NOTERAM_GETTASKNAME - * - Get task name string - * Argument: A writable pointer to struct note_get_taskname_s - * Result: If -ESRCH, the corresponding task name doesn't - * exist. - */ - - case NOTERAM_GETTASKNAME: - { - FAR struct noteram_get_taskname_s *param; - - if (arg == 0) - { - ret = -EINVAL; - break; - } - - param = (FAR struct noteram_get_taskname_s *)arg; - ret = note_get_taskname(param->pid, param->taskname); - } - break; -#endif - default: break; } @@ -851,15 +827,15 @@ get_task_context(pid_t pid, FAR struct noteram_dump_context_s *ctx) (*tctxp)->syscall_nest = 0; (*tctxp)->name[0] = '\0'; -#ifdef NOTERAM_GETTASKNAME +#ifdef CONFIG_DRIVERS_NOTE_TASKNAME_BUFSIZE { - struct noteram_get_taskname_s tnm; + char taskname[CONFIG_DRIVERS_NOTE_TASKNAME_BUFSIZE]; int res; - res = note_get_taskname(pid, tnm.taskname); + res = note_get_taskname(pid, taskname); if (res == 0) { - copy_task_name((*tctxp)->name, tnm.taskname); + copy_task_name((*tctxp)->name, taskname); } } #endif diff --git a/include/nuttx/note/noteram_driver.h b/include/nuttx/note/noteram_driver.h index c2e85a3f4e..ae9ccc1958 100644 --- a/include/nuttx/note/noteram_driver.h +++ b/include/nuttx/note/noteram_driver.h @@ -46,22 +46,12 @@ * NOTERAM_SETMODE * - Set overwrite mode * Argument: A read-only pointer to unsigned int - * NOTERAM_GETTASKNAME - * - Get task name string - * Argument: A writable pointer to struct - * noteram_get_taskname_s - * Result: If -ESRCH, the corresponding task name doesn't - * exist. */ #ifdef CONFIG_DRIVERS_NOTERAM #define NOTERAM_CLEAR _NOTERAMIOC(0x01) #define NOTERAM_GETMODE _NOTERAMIOC(0x02) #define NOTERAM_SETMODE _NOTERAMIOC(0x03) -#if defined(CONFIG_DRIVERS_NOTE_TASKNAME_BUFSIZE) && \ - CONFIG_DRIVERS_NOTE_TASKNAME_BUFSIZE > 0 -#define NOTERAM_GETTASKNAME _NOTERAMIOC(0x04) -#endif #endif /* Overwrite mode definitions */ @@ -76,15 +66,7 @@ * Public Types ****************************************************************************/ -/* This is the type of the argument passed to the NOTERAM_GETTASKNAME ioctl */ - -#ifdef NOTERAM_GETTASKNAME -struct noteram_get_taskname_s -{ - pid_t pid; - char taskname[CONFIG_TASK_NAME_SIZE + 1]; -}; -#endif +struct noteram_driver_s; /**************************************************************************** * Public Data