commit 4dd2e03b74a06ed433f3fe5dd5fb832a29e631ef
parent d38fcc52b2502815653d1d40512dfd1a68233281
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 30 Aug 2020 22:54:24 +0200
devcons: Fix prototype of conscmds
All the prototypes were receiving a char pointer, so it makes
more sense to use char pointer instead of void pointer which
discards any check between pointers.
Change-Id: I3e32fc235480718456223ba9718bd1cdbef56f82
Diffstat:
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/kernel/dev/devcons.c b/src/kernel/dev/devcons.c
@@ -78,7 +78,7 @@ consstatus(void *buf, Chan *c, int n)
}
static int
-consaddin(void *buf, int n)
+consaddin(char *buf, int n)
{
if (n >= NAMESIZE) {
errno = EINVAL;
@@ -96,7 +96,7 @@ consaddin(void *buf, int n)
}
static int
-consaddout(void *buf, int n)
+consaddout(char *buf, int n)
{
int i;
@@ -117,7 +117,7 @@ consaddout(void *buf, int n)
}
static int
-consdelin(void *buf, int n)
+consdelin(char *buf, int n)
{
if (n >= NAMESIZE) {
errno = EINVAL;
@@ -136,7 +136,7 @@ consdelin(void *buf, int n)
}
static int
-consdelout(void *buf, int n)
+consdelout(char *buf, int n)
{
int i;
@@ -158,10 +158,8 @@ consdelout(void *buf, int n)
}
static int
-consmode(void *buf, int n)
+consmode(char *arg, int n)
{
- char *arg = buf;
-
if (!strcmp(arg, "raw")) {
mode = RAW;
} else if(!strcmp(arg, "cooked")) {
@@ -213,11 +211,11 @@ conswrite(Chan *c, void *buf, int n)
{
char *tokens[2];
int i;
- int (*func)(void *, int);
+ int (*func)(char *, int);
struct conscmds {
const char name[7];
- int (*func)(void *, int);
+ int (*func)(char *, int);
};
static const struct conscmds conscmds[] = {