Re: [PATCH] usb: xhci: use BIT macro

lihuisong (C)
2026-03-14T02:36:58Z

Change below comment, then can add
Acked-by: lihuisong@huawei.com

On 3/12/2026 11:06 PM, Oliver Neukum wrote:
> We have the macro. Use it.
>
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> ---
> drivers/usb/host/xhci.h | 123 ++++++++++++++++++++--------------------
> 1 file changed, 62 insertions(+), 61 deletions(-)
<...>
> /* imod bitmasks */
> /*
> @@ -267,7 +268,7 @@ struct xhci_intr_reg {
> * bit 3 - Event Handler Busy (EHB), whether the event ring is scheduled to be serviced by
> * a work queue (or delayed service routine)?
> */
> -#define ERST_EHB (1 << 3)
> +#define ERST_EHB BIT(3)
> /* bits 63:4 - Event Ring Dequeue Pointer */
> #define ERST_PTR_MASK GENMASK_ULL(63, 4)
>
> @@ -356,15 +357,15 @@ struct xhci_slot_ctx {
> #define GET_DEV_SPEED(n) (((n) & DEV_SPEED) >> 20)
> /* bit 24 reserved */
> /* Is this LS/FS device connected through a HS hub? - bit 25 */
> -#define DEV_MTT (0x1 << 25)
> +#define DEV_MTT BIT(25)
> /* Set if the device is a hub - bit 26 */
> -#define DEV_HUB (0x1 << 26)
> +#define DEV_HUB BIT(26)
> /* Index of the last valid endpoint context in this device context - 27:31 */
> -#define LAST_CTX_MASK (0x1f << 27)
> +#define LAST_CTX_MASK BIT(27)
here is wrong.
> #define LAST_CTX(p) ((p) << 27)
> #define LAST_CTX_TO_EP_NUM(p) (((p) >> 27) - 1)
> -#define SLOT_FLAG (1 << 0)
> -#define EP0_FLAG (1 << 1)
> +#define SLOT_FLAG BIT(0)
> +#define EP0_FLAG BIT(1)
>