bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] fix warnings


From: Luca Dariz
Subject: [PATCH 4/4] fix warnings
Date: Mon, 16 Jan 2023 14:04:26 +0100

* ipc/ipc_kmsg.c: fix cast to the correct pointer type
* ipc/ipc_port.c: upcast rpc_vm_offset_t to full vm_offset_t
* kern/pc_sample.c: Likewise
---
 ipc/ipc_kmsg.c   | 5 ++---
 ipc/ipc_port.c   | 2 +-
 kern/pc_sample.c | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c
index 2477c576..2ebd729b 100644
--- a/ipc/ipc_kmsg.c
+++ b/ipc/ipc_kmsg.c
@@ -2434,11 +2434,10 @@ ipc_kmsg_copyout_body(
                        /* copyout port rights carried in the message */
 
                        for (i = 0; i < number; i++) {
-                               ipc_object_t object =
-                                       (ipc_object_t) objects[i];
+                               ipc_object_t object = objects[i];
 
                                mr |= ipc_kmsg_copyout_object_to_port(space, 
object,
-                                                                      name, 
&objects[i]);
+                                                                      name, 
(mach_port_t*)&objects[i]);
                        }
                }
 
diff --git a/ipc/ipc_port.c b/ipc/ipc_port.c
index be6e06ac..f9ccc290 100644
--- a/ipc/ipc_port.c
+++ b/ipc/ipc_port.c
@@ -1283,7 +1283,7 @@ ipc_port_print(port)
        printf(", sndrs=0x%x", port->ip_blocked.ithq_base);
        printf(", kobj=0x%x\n", port->ip_kobject);
 
-       iprintf("protected_payload=%p\n", (void *) port->ip_protected_payload);
+       iprintf("protected_payload=%p\n", (void *) (vm_offset_t) 
port->ip_protected_payload);
 
        indent -= 2;
 }
diff --git a/kern/pc_sample.c b/kern/pc_sample.c
index 280d8b54..d13beb07 100644
--- a/kern/pc_sample.c
+++ b/kern/pc_sample.c
@@ -61,7 +61,7 @@ void take_pc_sample(
 
     cp->seqno++;
     sample = &((sampled_pc_t *)cp->buffer)[cp->seqno % MAX_PC_SAMPLES];
-    sample->id = (rpc_vm_offset_t)t;
+    sample->id = (rpc_vm_offset_t)(vm_offset_t)t;
     sample->pc = (rpc_vm_offset_t)pc;
     sample->sampletype = flavor;
 }
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]