summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorxiao-mang <[email protected]>2023-07-24 09:12:35 +0800
committerGitHub <[email protected]>2023-07-24 09:12:35 +0800
commitbefa95145115492c5c521f513b6ff075b0efdc80 (patch)
tree5aad5415138ce20d8fb9040a92ed6b859d90cbbb /components/drivers
parentfc28baeb15f56db409533b52d2a85a772fff4cd1 (diff)
modify some function prototypes of the dfs_file_ops structure and the function declarations based on it (#7849)
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/ipc/pipe.c8
-rw-r--r--components/drivers/serial/serial.c8
-rw-r--r--components/drivers/tty/tty.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/components/drivers/ipc/pipe.c b/components/drivers/ipc/pipe.c
index d1e8665963..acd0c2def6 100644
--- a/components/drivers/ipc/pipe.c
+++ b/components/drivers/ipc/pipe.c
@@ -203,9 +203,9 @@ static int pipe_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
* When the return value is -EAGAIN, it means there are no data to be read.
*/
#ifdef RT_USING_DFS_V2
-static int pipe_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
+static ssize_t pipe_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
#else
-static int pipe_fops_read(struct dfs_file *fd, void *buf, size_t count)
+static ssize_t pipe_fops_read(struct dfs_file *fd, void *buf, size_t count)
#endif
{
int len = 0;
@@ -261,9 +261,9 @@ out:
* When the return value is -EPIPE, it means there is no thread that has the pipe open for reading.
*/
#ifdef RT_USING_DFS_V2
-static int pipe_fops_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
+static ssize_t pipe_fops_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
#else
-static int pipe_fops_write(struct dfs_file *fd, const void *buf, size_t count)
+static ssize_t pipe_fops_write(struct dfs_file *fd, const void *buf, size_t count)
#endif
{
int len;
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c
index fd904078f7..1777a231b3 100644
--- a/components/drivers/serial/serial.c
+++ b/components/drivers/serial/serial.c
@@ -136,9 +136,9 @@ static int serial_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
}
#ifdef RT_USING_DFS_V2
-static int serial_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
+static ssize_t serial_fops_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
#else
-static int serial_fops_read(struct dfs_file *fd, void *buf, size_t count)
+static ssize_t serial_fops_read(struct dfs_file *fd, void *buf, size_t count)
#endif
{
int size = 0;
@@ -174,9 +174,9 @@ static int serial_fops_read(struct dfs_file *fd, void *buf, size_t count)
}
#ifdef RT_USING_DFS_V2
-static int serial_fops_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
+static ssize_t serial_fops_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
#else
-static int serial_fops_write(struct dfs_file *fd, const void *buf, size_t count)
+static ssize_t serial_fops_write(struct dfs_file *fd, const void *buf, size_t count)
#endif
{
rt_device_t device;
diff --git a/components/drivers/tty/tty.c b/components/drivers/tty/tty.c
index 53f7ae1e59..30ab00d890 100644
--- a/components/drivers/tty/tty.c
+++ b/components/drivers/tty/tty.c
@@ -306,9 +306,9 @@ static int tty_ioctl(struct dfs_file *fd, int cmd, void *args)
}
#ifdef RT_USING_DFS_V2
-static int tty_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
+static ssize_t tty_read(struct dfs_file *fd, void *buf, size_t count, off_t *pos)
#else
-static int tty_read(struct dfs_file *fd, void *buf, size_t count)
+static ssize_t tty_read(struct dfs_file *fd, void *buf, size_t count)
#endif
{
int ret = 0;
@@ -327,9 +327,9 @@ static int tty_read(struct dfs_file *fd, void *buf, size_t count)
}
#ifdef RT_USING_DFS_V2
-static int tty_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
+static ssize_t tty_write(struct dfs_file *fd, const void *buf, size_t count, off_t *pos)
#else
-static int tty_write(struct dfs_file *fd, const void *buf, size_t count )
+static ssize_t tty_write(struct dfs_file *fd, const void *buf, size_t count )
#endif
{
int ret = 0;