From: jsg Date: Tue, 23 Apr 2024 04:12:53 +0000 (+0000) Subject: simplify bit shift; avoids shifting into int sign bit X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=26e07adb1d7a1c3f1edc6f44e7cd1beaeff50821;p=openbsd simplify bit shift; avoids shifting into int sign bit ok kettenis@ miod@ --- 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;