From 69f9b600bc06797db3d0e01d555f6f9ead69a975 Mon Sep 17 00:00:00 2001 From: drahn Date: Sat, 22 May 2021 17:07:28 +0000 Subject: [PATCH] Cast line_size to address width before using for alignment. ok kettenis@ --- sys/arch/riscv64/dev/sfcc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.20.1