|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] xhci-dbc: don't cast away const-ness in xhci_find_dbc()
commit 769263b1241fcfcd85096ae021424a7a5f24ea63
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Sep 3 09:58:18 2026 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Sep 3 10:59:58 2026 +0200
xhci-dbc: don't cast away const-ness in xhci_find_dbc()
Doing so (at the return statement), besides being a bad idea anyway, is a
violation of Misra rule 11.8.
Make "xcap" have an initializer while adjusting the code anyway.
No functional change intended.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
---
xen/drivers/char/xhci-dbc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/xen/drivers/char/xhci-dbc.c b/xen/drivers/char/xhci-dbc.c
index c1ff528de6..5651cb179b 100644
--- a/xen/drivers/char/xhci-dbc.c
+++ b/xen/drivers/char/xhci-dbc.c
@@ -384,16 +384,15 @@ static bool __init dbc_init_xhc(struct dbc *dbc)
*/
static struct dbc_reg __iomem *xhci_find_dbc(struct dbc *dbc)
{
- const uint32_t __iomem *xcap;
uint32_t xcap_val;
uint32_t next;
uint32_t id = 0;
- const void __iomem *mmio = dbc->xhc_mmio;
+ void __iomem *mmio = dbc->xhc_mmio;
const uint32_t __iomem *hccp1 = mmio + 0x10;
+ uint32_t __iomem *xcap = mmio;
const uint32_t DBC_ID = 0xA;
int ttl = 48;
- xcap = mmio;
/*
* This is initially an offset to the first capability. All the offsets
* (both in HCCP1 and then next capability pointer) are dword-based.
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |