From: mglocker Date: Thu, 9 May 2024 08:13:57 +0000 (+0000) Subject: Use 1U for bit operations on 32-bit registers. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c4dc76d15129df91f5f0f736be579e33eb781f9e;p=openbsd Use 1U for bit operations on 32-bit registers. Proposed by dlg@ --- diff --git a/sys/dev/ic/ufshci.c b/sys/dev/ic/ufshci.c index ebca598f895..a6363edae5c 100644 --- a/sys/dev/ic/ufshci.c +++ b/sys/dev/ic/ufshci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufshci.c,v 1.14 2024/05/09 08:12:22 mglocker Exp $ */ +/* $OpenBSD: ufshci.c,v 1.15 2024/05/09 08:13:57 mglocker Exp $ */ /* * Copyright (c) 2022 Marcus Glocker @@ -451,7 +451,7 @@ ufshci_doorbell_write(struct ufshci_softc *sc, int slot) { uint32_t reg; - reg = (1 << slot); + reg = (1U << slot); UFSHCI_WRITE_4(sc, UFSHCI_REG_UTRLDBR, reg); } @@ -466,7 +466,7 @@ ufshci_doorbell_poll(struct ufshci_softc *sc, int slot) for (i = 0; i < retry; i++) { reg = UFSHCI_READ_4(sc, UFSHCI_REG_UTRLDBR); - if ((reg & (1 << slot)) == 0) + if ((reg & (1U << slot)) == 0) break; delay(10); }