Module Name:    src
Committed By:   andvar
Date:           Wed Dec 13 20:53:15 UTC 2023

Modified Files:
        src/sys/arch/sgimips/gio: grtwo.c light.c
        src/sys/arch/sgimips/hpc: hpcdma.c

Log Message:
Add (intptr_t) casts to fix "cast to pointer from integer of different size",
mainly for GENERIC64_32_* configs.
Also change segp->ds_len format specifier to %lld, which fixes DMA_DEBUG build.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sgimips/gio/grtwo.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sgimips/gio/light.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sgimips/hpc/hpcdma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sgimips/gio/grtwo.c
diff -u src/sys/arch/sgimips/gio/grtwo.c:1.18 src/sys/arch/sgimips/gio/grtwo.c:1.19
--- src/sys/arch/sgimips/gio/grtwo.c:1.18	Sat Aug  7 16:19:04 2021
+++ src/sys/arch/sgimips/gio/grtwo.c	Wed Dec 13 20:53:14 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: grtwo.c,v 1.18 2021/08/07 16:19:04 thorpej Exp $	 */
+/* $NetBSD: grtwo.c,v 1.19 2023/12/13 20:53:14 andvar Exp $	 */
 
 /*
  * Copyright (c) 2004 Christopher SEKIYA
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: grtwo.c,v 1.18 2021/08/07 16:19:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grtwo.c,v 1.19 2023/12/13 20:53:14 andvar Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -454,7 +454,7 @@ grtwo_match(device_t parent, cfdata_t cf
 	 * ID.  Instead, we determine presence by looking at the HQ2 "mystery"
 	 * register, which contains a magic number.
 	 */
-	if ( platform.badaddr((void *) (ga->ga_ioh + HQ2_MYSTERY),
+	if ( platform.badaddr((void *)(intptr_t)(ga->ga_ioh + HQ2_MYSTERY),
 	    sizeof(u_int32_t)) )
 		return 0;
 

Index: src/sys/arch/sgimips/gio/light.c
diff -u src/sys/arch/sgimips/gio/light.c:1.10 src/sys/arch/sgimips/gio/light.c:1.11
--- src/sys/arch/sgimips/gio/light.c:1.10	Sat Aug  7 16:19:04 2021
+++ src/sys/arch/sgimips/gio/light.c	Wed Dec 13 20:53:14 2023
@@ -1,4 +1,4 @@
-/*	$Id: light.c,v 1.10 2021/08/07 16:19:04 thorpej Exp $	*/
+/*	$Id: light.c,v 1.11 2023/12/13 20:53:14 andvar Exp $	*/
 
 /*
  * Copyright (c) 2006 Stephen M. Rumble
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: light.c,v 1.10 2021/08/07 16:19:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: light.c,v 1.11 2023/12/13 20:53:14 andvar Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -271,7 +271,7 @@ light_match(device_t parent, cfdata_t cf
 		return (0);
 
 	if (platform.badaddr(
-	    (void *)(ga->ga_ioh + REX_PAGE1_SET + REX_P1REG_XYOFFSET),
+	    (void *)(intptr_t)(ga->ga_ioh + REX_PAGE1_SET + REX_P1REG_XYOFFSET),
 	    sizeof(uint32_t)))
 		return (0);
 

Index: src/sys/arch/sgimips/hpc/hpcdma.c
diff -u src/sys/arch/sgimips/hpc/hpcdma.c:1.21 src/sys/arch/sgimips/hpc/hpcdma.c:1.22
--- src/sys/arch/sgimips/hpc/hpcdma.c:1.21	Fri Jul  1 18:53:46 2011
+++ src/sys/arch/sgimips/hpc/hpcdma.c	Wed Dec 13 20:53:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcdma.c,v 1.21 2011/07/01 18:53:46 dyoung Exp $	*/
+/*	$NetBSD: hpcdma.c,v 1.22 2023/12/13 20:53:14 andvar Exp $	*/
 
 /*
  * Copyright (c) 2001 Wayne Knowles
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpcdma.c,v 1.21 2011/07/01 18:53:46 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcdma.c,v 1.22 2023/12/13 20:53:14 andvar Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -133,7 +133,7 @@ hpcdma_sglist_create(struct hpc_dma_soft
 #endif
 	for (i = dmamap->dm_nsegs; i; i--) {
 #ifdef DMA_DEBUG
-		printf("%p:%ld, ", (void *)segp->ds_addr, segp->ds_len);
+		printf("%p:%lld, ", (void *)(intptr_t)segp->ds_addr, segp->ds_len);
 #endif
 		hpa += sizeof(struct hpc_dma_desc);	/* next chain desc */
 		if (sc->hpc->revision == 3) {

Reply via email to