Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2023 22:13:03 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: becebbab43c7 - stable/13 - ofw: Cast function pointer to proper type
Message-ID:  <202301242213.30OMD3dH087875@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=becebbab43c7a52b9075b471dde514a76a1687a6

commit becebbab43c7a52b9075b471dde514a76a1687a6
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-11-27 20:23:28 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:37 +0000

    ofw: Cast function pointer to proper type
    
    clang 15 insists that we call entry() via a function prototype. Rather
    than copping out and using (...), cast it to the same prototype that's
    used elsewhere (with tweaks to pointers to make them fit into that
    prototype). No functional change.
    
    Sponsored by:           Netflix
    
    (cherry picked from commit fea231d21b299535302b41ac2e841f8abf1787fc)
---
 stand/libofw/openfirm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/stand/libofw/openfirm.c b/stand/libofw/openfirm.c
index b2b89581ae70..b780a9e36125 100644
--- a/stand/libofw/openfirm.c
+++ b/stand/libofw/openfirm.c
@@ -772,6 +772,7 @@ OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len)
 	if (size > 0)
 		OF_release(virt, size);
 #endif
-	entry(0, 0, openfirmware, arg, len);
+	((int (*)(u_long, u_long, u_long, void *, u_long))entry)
+	    (0, 0, (u_long)openfirmware, arg, len);
 }
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301242213.30OMD3dH087875>