]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/block/cciss.c
cciss: add BUILD_BUG_ON() for catching bad CommandList_struct alignment
[linux-2.6-omap-h63xx.git] / drivers / block / cciss.c
index 4f9b6d7920173d19f85dc0cb822c3e33d87b1db9..5d0e135824f9c3e96bb76de0c5f88b259d50a241 100644 (file)
@@ -3898,6 +3898,13 @@ static struct pci_driver cciss_pci_driver = {
  */
 static int __init cciss_init(void)
 {
+       /*
+        * The hardware requires that commands are aligned on a 64-bit
+        * boundary. Given that we use pci_alloc_consistent() to allocate an
+        * array of them, the size must be a multiple of 8 bytes.
+        */
+       BUILD_BUG_ON(sizeof(CommandList_struct) % 8);
+
        printk(KERN_INFO DRIVER_NAME "\n");
 
        /* Register for our PCI devices */