From 26e07adb1d7a1c3f1edc6f44e7cd1beaeff50821 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 23 Apr 2024 04:12:53 +0000 Subject: [PATCH] simplify bit shift; avoids shifting into int sign bit ok kettenis@ miod@ --- sys/dev/usb/xhcireg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/xhcireg.h b/sys/dev/usb/xhcireg.h index 41535c36737..8546849547d 100644 --- a/sys/dev/usb/xhcireg.h +++ b/sys/dev/usb/xhcireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xhcireg.h,v 1.18 2022/01/09 05:43:02 jsg Exp $ */ +/* $OpenBSD: xhcireg.h,v 1.19 2024/04/23 04:12:53 jsg Exp $ */ /*- * Copyright (c) 2014 Martin Pieuchot. All rights reserved. @@ -335,7 +335,7 @@ struct xhci_inctx { struct xhci_trb { uint64_t trb_paddr; -#define XHCI_TRB_PORTID(x) (((x) & (0xff << 24)) >> 24) /* Port ID */ +#define XHCI_TRB_PORTID(x) (((x) >> 24) & 0xff) /* Port ID */ #define XHCI_TRB_MAXSIZE (64 * 1024) uint32_t trb_status; -- 2.20.1