]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
reboot-util: drop unnecessary cast 25244/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Nov 2022 00:19:07 +0000 (09:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 4 Nov 2022 02:32:34 +0000 (11:32 +0900)
Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.

src/shared/reboot-util.c

index 10d49ba63a0869a2a550c18702c299919eb97c5b..7fa3ff98b69deedc97e4951ac0709afb430054ed 100644 (file)
@@ -122,9 +122,9 @@ int shall_restore_state(void) {
 
 static int xen_kexec_loaded(void) {
 #if HAVE_XENCTRL
-        size_t size;
         _cleanup_close_ int privcmd_fd = -1, buf_fd = -1;
-        void *buffer;
+        xen_kexec_status_t *buffer;
+        size_t size;
         int r;
 
         if (access("/proc/xen", F_OK) < 0) {
@@ -149,7 +149,7 @@ static int xen_kexec_loaded(void) {
         if (buffer == MAP_FAILED)
                 return log_debug_errno(errno, "Cannot allocate buffer for hypercall: %m");
 
-        *(xen_kexec_status_t*) buffer = (xen_kexec_status_t) {
+        *buffer = (xen_kexec_status_t) {
                 .type = KEXEC_TYPE_DEFAULT,
         };