From: drahn Date: Sat, 22 May 2021 17:07:28 +0000 (+0000) Subject: Cast line_size to address width before using for alignment. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=69f9b600bc06797db3d0e01d555f6f9ead69a975;p=openbsd Cast line_size to address width before using for alignment. ok kettenis@ --- diff --git a/sys/arch/riscv64/dev/sfcc.c b/sys/arch/riscv64/dev/sfcc.c index b05401d7e50..7b87447094c 100644 --- a/sys/arch/riscv64/dev/sfcc.c +++ b/sys/arch/riscv64/dev/sfcc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sfcc.c,v 1.1 2021/05/05 19:26:51 kettenis Exp $ */ +/* $OpenBSD: sfcc.c,v 1.2 2021/05/22 17:07:28 drahn Exp $ */ /* * Copyright (c) 2021 Mark Kettenis * @@ -98,7 +98,7 @@ sfcc_cache_wbinv_range(paddr_t pa, paddr_t len) struct sfcc_softc *sc = sfcc_sc; len += pa & (sc->sc_line_size - 1); - pa &= ~(sc->sc_line_size - 1); + pa &= ~((paddr_t)sc->sc_line_size - 1); __asm volatile ("fence iorw,iorw" ::: "memory"); while (len > 0) {