This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit f9c1117c884d4047fb3d465659856ec6699e6dc7 Author: Xiang Xiao <[email protected]> AuthorDate: Sat Dec 18 02:31:05 2021 +0800 eventfd: Remove the unused and private eventfd_get_minor since it isn't defined by Linux kernel too Signed-off-by: Xiang Xiao <[email protected]> --- fs/vfs/fs_eventfd.c | 21 ++------------------- include/nuttx/fs/ioctl.h | 8 ++------ include/sys/eventfd.h | 6 ------ libs/libc/eventfd/lib_eventfd.c | 15 --------------- 4 files changed, 4 insertions(+), 46 deletions(-) diff --git a/fs/vfs/fs_eventfd.c b/fs/vfs/fs_eventfd.c index 490d2cc..38fce3d 100644 --- a/fs/vfs/fs_eventfd.c +++ b/fs/vfs/fs_eventfd.c @@ -91,8 +91,6 @@ static ssize_t eventfd_do_read(FAR struct file *filep, FAR char *buffer, size_t len); static ssize_t eventfd_do_write(FAR struct file *filep, FAR const char *buffer, size_t len); -static int eventfd_do_ioctl(FAR struct file *filep, int cmd, - unsigned long arg); #ifdef CONFIG_EVENT_FD_POLL static int eventfd_do_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup); @@ -121,8 +119,8 @@ static const struct file_operations g_eventfd_fops = eventfd_do_close, /* close */ eventfd_do_read, /* read */ eventfd_do_write, /* write */ - 0, /* seek */ - eventfd_do_ioctl /* ioctl */ + NULL, /* seek */ + NULL /* ioctl */ #ifdef CONFIG_EVENT_FD_POLL , eventfd_do_poll /* poll */ #endif @@ -475,21 +473,6 @@ static ssize_t eventfd_do_write(FAR struct file *filep, return sizeof(eventfd_t); } -static int eventfd_do_ioctl(FAR struct file *filep, int cmd, - unsigned long arg) -{ - FAR struct inode *inode = filep->f_inode; - FAR struct eventfd_priv_s *priv = inode->i_private; - - if (cmd == FIOC_MINOR) - { - *(FAR int *)((uintptr_t)arg) = priv->minor; - return OK; - } - - return -ENOSYS; -} - #ifdef CONFIG_EVENT_FD_POLL static int eventfd_do_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) diff --git a/include/nuttx/fs/ioctl.h b/include/nuttx/fs/ioctl.h index 1e84674..74a529b 100644 --- a/include/nuttx/fs/ioctl.h +++ b/include/nuttx/fs/ioctl.h @@ -169,14 +169,10 @@ * int value. * OUT: Origin option. */ -#define FIOC_MINOR _FIOC(0x000c) /* IN: None - * OUT: Integer that contains device - * minor number - */ -#define FIOCLEX _FIOC(0x000d) /* IN: None +#define FIOCLEX _FIOC(0x000c) /* IN: None * OUT: None */ -#define FIONCLEX _FIOC(0x000e) /* IN: None +#define FIONCLEX _FIOC(0x000d) /* IN: None * OUT: None */ diff --git a/include/sys/eventfd.h b/include/sys/eventfd.h index bb358b2..45a6753 100644 --- a/include/sys/eventfd.h +++ b/include/sys/eventfd.h @@ -36,10 +36,6 @@ #define EFD_SEMAPHORE O_BINARY #define EFD_CLOEXEC O_CLOEXEC -/* Get device minor number */ - -#define EFD_FIOC_MINOR FIOC_MINOR - /**************************************************************************** * Public Type Declarations ****************************************************************************/ @@ -65,8 +61,6 @@ int eventfd(unsigned int count, int flags); int eventfd_read(int fd, FAR eventfd_t *value); int eventfd_write(int fd, eventfd_t value); -int eventfd_get_minor(int fd); - #undef EXTERN #ifdef __cplusplus } diff --git a/libs/libc/eventfd/lib_eventfd.c b/libs/libc/eventfd/lib_eventfd.c index dca525e..08ad68d 100644 --- a/libs/libc/eventfd/lib_eventfd.c +++ b/libs/libc/eventfd/lib_eventfd.c @@ -40,18 +40,3 @@ int eventfd_write(int fd, eventfd_t value) return write(fd, &value, sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0; } - -int eventfd_get_minor(int fd) -{ - int ret; - int minor; - - ret = ioctl(fd, EFD_FIOC_MINOR, &minor); - - if (ret < 0) - { - return ret; - } - - return minor; -}
