summaryrefslogtreecommitdiff
path: root/src/kernel/arch
diff options
context:
space:
mode:
authordzwdz2022-05-05 22:58:01 +0200
committerdzwdz2022-05-05 22:58:01 +0200
commit5418a2e1bbc26660bb8579c57fa19e4a04c34200 (patch)
tree6e5c5a4e49f2d59c2e958711eee2070c351cc6df /src/kernel/arch
parent40f4fb7c9879c678fa82906116fefdaed63aaed6 (diff)
kernel: fix a few minor compiler warnings
Diffstat (limited to 'src/kernel/arch')
-rw-r--r--src/kernel/arch/i386/driver/fsroot.c2
-rw-r--r--src/kernel/arch/i386/driver/ps2.c6
-rw-r--r--src/kernel/arch/i386/driver/serial.c4
-rw-r--r--src/kernel/arch/i386/sysenter.c5
-rw-r--r--src/kernel/arch/i386/tty/tty.c2
5 files changed, 10 insertions, 9 deletions
diff --git a/src/kernel/arch/i386/driver/fsroot.c b/src/kernel/arch/i386/driver/fsroot.c
index 49cecc9..e6e53cd 100644
--- a/src/kernel/arch/i386/driver/fsroot.c
+++ b/src/kernel/arch/i386/driver/fsroot.c
@@ -136,7 +136,7 @@ static void accept(struct vfs_request *req) {
}
}
-static bool is_ready(struct vfs_backend *self) {
+static bool is_ready(struct vfs_backend __attribute__((unused)) *self) {
return true;
}
diff --git a/src/kernel/arch/i386/driver/ps2.c b/src/kernel/arch/i386/driver/ps2.c
index 97e2878..aaa3156 100644
--- a/src/kernel/arch/i386/driver/ps2.c
+++ b/src/kernel/arch/i386/driver/ps2.c
@@ -54,7 +54,7 @@ static void accept(struct vfs_request *req) {
if (req->caller) {
// clamp between 0, sizeof buf
ret = req->output.len;
- if (ret > sizeof buf) ret = sizeof buf;
+ if (ret > (int)sizeof buf) ret = sizeof buf;
if (ret < 0) ret = 0;
ret = ps2_read(buf, ret);
@@ -71,4 +71,6 @@ static void accept(struct vfs_request *req) {
}
}
-static bool is_ready(struct vfs_backend *self) { return blocked_on == NULL; }
+static bool is_ready(struct vfs_backend __attribute__((unused)) *self) {
+ return blocked_on == NULL;
+}
diff --git a/src/kernel/arch/i386/driver/serial.c b/src/kernel/arch/i386/driver/serial.c
index 614d4e0..12cf2b8 100644
--- a/src/kernel/arch/i386/driver/serial.c
+++ b/src/kernel/arch/i386/driver/serial.c
@@ -92,7 +92,7 @@ static void accept(struct vfs_request *req) {
if (req->caller) {
// clamp between 0, sizeof buf
ret = req->output.len;
- if (ret > sizeof buf) ret = sizeof buf;
+ if (ret > (int)sizeof buf) ret = sizeof buf;
if (ret < 0) ret = 0;
ret = serial_read(buf, ret);
@@ -120,4 +120,4 @@ static void accept(struct vfs_request *req) {
}
}
-static bool is_ready(struct vfs_backend *self) { return blocked_on == NULL; }
+static bool is_ready(struct vfs_backend __attribute__((unused)) *self) { return blocked_on == NULL; }
diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c
index 71dfbe9..5837474 100644
--- a/src/kernel/arch/i386/sysenter.c
+++ b/src/kernel/arch/i386/sysenter.c
@@ -14,14 +14,13 @@ void sysexit(struct registers regs) {
}
_Noreturn void sysenter_stage2(void) {
- uint64_t val;
struct registers *regs = &process_current->regs;
*regs = _sysexit_regs; // save the registers
regs->esp = (userptr_t) regs->ecx; // fix them up
regs->eip = (userptr_t) regs->edx;
- val = _syscall(regs->eax, regs->ebx,
- regs->esi, regs->edi, (uintptr_t)regs->ebp);
+ _syscall(regs->eax, regs->ebx,
+ regs->esi, regs->edi, (uintptr_t)regs->ebp);
process_switch_any();
}
diff --git a/src/kernel/arch/i386/tty/tty.c b/src/kernel/arch/i386/tty/tty.c
index a1964f9..aa63507 100644
--- a/src/kernel/arch/i386/tty/tty.c
+++ b/src/kernel/arch/i386/tty/tty.c
@@ -11,7 +11,7 @@ void tty_init(void) {
serial_write("<3 ", 3);
}
-static void backend(void *arg, const char *buf, size_t len) {
+static void backend(void __attribute__((unused)) *arg, const char *buf, size_t len) {
vga_write(buf, len);
serial_write(buf, len);
}