Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix "error: cast from pointer to integer of differe...



details:   https://anonhg.NetBSD.org/src/rev/8d188992cb76
branches:  trunk
changeset: 369814:8d188992cb76
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Fri Sep 02 06:01:38 2022 +0000

description:
Fix "error: cast from pointer to integer of different size" on
sparc build.

diffstat:

 sys/kern/subr_lockdebug.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r fb6947f417bf -r 8d188992cb76 sys/kern/subr_lockdebug.c
--- a/sys/kern/subr_lockdebug.c Fri Sep 02 05:50:36 2022 +0000
+++ b/sys/kern/subr_lockdebug.c Fri Sep 02 06:01:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_lockdebug.c,v 1.82 2022/08/31 05:24:41 msaitoh Exp $      */
+/*     $NetBSD: subr_lockdebug.c,v 1.83 2022/09/02 06:01:38 nakayama Exp $     */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.82 2022/08/31 05:24:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.83 2022/09/02 06:01:38 nakayama Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -729,7 +729,7 @@
        char locksym[128], initsym[128], lockedsym[128], unlockedsym[128];
 
 #ifdef DDB
-       db_symstr(locksym, sizeof(locksym), (db_expr_t)ld->ld_lock,
+       db_symstr(locksym, sizeof(locksym), (db_expr_t)(intptr_t)ld->ld_lock,
            DB_STGY_ANY);
        db_symstr(initsym, sizeof(initsym), (db_expr_t)ld->ld_initaddr,
            DB_STGY_PROC);
@@ -855,7 +855,7 @@
        uintptr_t word;
 
        (*pr)("WARNING: lock print is unreliable without LOCKDEBUG\n");
-       db_symstr(sym, sizeof(sym), (db_expr_t)addr, DB_STGY_ANY);
+       db_symstr(sym, sizeof(sym), (db_expr_t)(intptr_t)addr, DB_STGY_ANY);
        db_read_bytes((db_addr_t)addr, sizeof(word), (char *)&word);
        (*pr)("%s: possible owner: %p, bits: 0x%" PRIxPTR "\n", sym,
            (void *)(word & ~(uintptr_t)ALIGNBYTES), word & ALIGNBYTES);
@@ -1075,7 +1075,8 @@
        char locksym[128];
 
 #ifdef DDB
-       db_symstr(locksym, sizeof(locksym), (db_expr_t)lock, DB_STGY_ANY);
+       db_symstr(locksym, sizeof(locksym), (db_expr_t)(intptr_t)lock,
+           DB_STGY_ANY);
 #else
        snprintf(locksym, sizeof(locksym), "%#018lx", (unsigned long)lock);
 #endif



Home | Main Index | Thread Index | Old Index