diff options
Diffstat (limited to 'drivers/usb/host/xhci-hcd.c')
-rw-r--r-- | drivers/usb/host/xhci-hcd.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c index c6b921994b28..59ee61d2a198 100644 --- a/drivers/usb/host/xhci-hcd.c +++ b/drivers/usb/host/xhci-hcd.c | |||
@@ -1243,6 +1243,25 @@ static int __init xhci_hcd_init(void) | |||
1243 | return retval; | 1243 | return retval; |
1244 | } | 1244 | } |
1245 | #endif | 1245 | #endif |
1246 | /* | ||
1247 | * Check the compiler generated sizes of structures that must be laid | ||
1248 | * out in specific ways for hardware access. | ||
1249 | */ | ||
1250 | BUILD_BUG_ON(sizeof(struct xhci_doorbell_array) != 256*32/8); | ||
1251 | BUILD_BUG_ON(sizeof(struct xhci_slot_ctx) != 8*32/8); | ||
1252 | BUILD_BUG_ON(sizeof(struct xhci_ep_ctx) != 8*32/8); | ||
1253 | /* xhci_device_control has eight fields, and also | ||
1254 | * embeds one xhci_slot_ctx and 31 xhci_ep_ctx | ||
1255 | */ | ||
1256 | BUILD_BUG_ON(sizeof(struct xhci_device_control) != (8+8+8*31)*32/8); | ||
1257 | BUILD_BUG_ON(sizeof(struct xhci_stream_ctx) != 4*32/8); | ||
1258 | BUILD_BUG_ON(sizeof(union xhci_trb) != 4*32/8); | ||
1259 | BUILD_BUG_ON(sizeof(struct xhci_erst_entry) != 4*32/8); | ||
1260 | BUILD_BUG_ON(sizeof(struct xhci_cap_regs) != 7*32/8); | ||
1261 | BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8); | ||
1262 | /* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */ | ||
1263 | BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8); | ||
1264 | BUILD_BUG_ON(sizeof(struct xhci_doorbell_array) != 256*32/8); | ||
1246 | return 0; | 1265 | return 0; |
1247 | } | 1266 | } |
1248 | module_init(xhci_hcd_init); | 1267 | module_init(xhci_hcd_init); |