eventfd: Remove the unused and private eventfd_get_minor

since it isn't defined by Linux kernel too

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-12-18 02:31:05 +08:00 committed by Xiang Xiao
parent e269b5fa28
commit f9c1117c88
4 changed files with 4 additions and 46 deletions

View File

@ -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)

View File

@ -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
*/

View File

@ -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
}

View File

@ -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;
}