sst-linux/drivers/usb
Niklas Neronin 1c80787ecd usb: xhci: correct debug message page size calculation
[ Upstream commit 55741c723318905e6d5161bf1e12749020b161e3 ]

The ffs() function returns the index of the first set bit, starting from 1.
If no bits are set, it returns zero. This behavior causes an off-by-one
page size in the debug message, as the page size calculation [1]
is zero-based, while ffs() is one-based.

Fix this by subtracting one from the result of ffs(). Note that since
variable 'val' is unsigned, subtracting one from zero will result in the
maximum unsigned integer value. Consequently, the condition 'if (val < 16)'
will still function correctly.

[1], Page size: (2^(n+12)), where 'n' is the set page size bit.

Fixes: 81720ec532 ("usb: host: xhci: use ffs() in xhci_mem_init()")
Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250306144954.3507700-9-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-10 14:33:36 +02:00
..
atm usb: atm: cxacru: fix a flaw in existing endpoint checks 2025-03-13 12:53:20 +01:00
c67x00
cdns3 usb: cdns3: Add quirk flag to enable suspend residency 2024-12-27 13:52:51 +01:00
chipidea usb: chipidea: ci_hdrc_imx: decrement device's refcount in .remove() and in the error path of .probe() 2025-02-21 13:49:35 +01:00
class usb: cdc-acm: Fix handling of oversized fragments 2025-02-21 13:50:03 +01:00
common
core usb: quirks: Add DELAY_INIT and NO_LPM for Prolific Mass Storage Card Reader 2025-03-13 12:53:20 +01:00
dwc2 usb: dwc2: gadget: remove of_node reference upon udc_stop 2025-02-21 13:50:02 +01:00
dwc3 usb: dwc3: gadget: Prevent irq storm when TH re-executes 2025-03-13 12:53:20 +01:00
early
gadget usb: gadget: uvc: Fix ERR_PTR dereference in uvc_v4l2.c 2025-04-07 10:05:46 +02:00
host usb: xhci: correct debug message page size calculation 2025-04-10 14:33:36 +02:00
image
isp1760
misc USB: chaoskey: Fix possible deadlock chaoskey_list_lock 2024-12-14 19:53:53 +01:00
mon
mtu3
musb usb: musb: Fix hardware lockup on first Rx endpoint request 2024-12-14 19:54:05 +01:00
phy usb: phy: Fix API devm_usb_put_phy() can not release the phy 2024-11-08 16:26:44 +01:00
renesas_usbhs usb: renesas_usbhs: Flush the notify_hotplug_work 2025-03-13 12:53:20 +01:00
roles usb: roles: set switch registered flag early on 2025-02-21 13:50:01 +01:00
serial USB: serial: option: match on interface class for Telit FN990B 2025-03-28 21:58:56 +01:00
storage usb-storage: Add max sectors quirk for Nokia 208 2025-01-17 13:34:44 +01:00
typec usb: typec: ucsi: Fix NULL pointer access 2025-04-07 10:05:46 +02:00
usbip usbip: Don't submit special requests twice 2024-09-08 07:53:10 +02:00
Kconfig
Makefile
usb-skeleton.c