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
chipidea
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
mon
mtu3
musb
phy
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
typec usb: typec: ucsi: Fix NULL pointer access 2025-04-07 10:05:46 +02:00
usbip
Kconfig
Makefile
usb-skeleton.c