提交 10cbda97 编写于 作者: J Jens Axboe

cciss: add BUILD_BUG_ON() for catching bad CommandList_struct alignment

The hardware requires 64-bit alignment of commands, so add a build bug
check for that. The recent commit 8a3173de
didn't change the size of the command, but other additions/changes may and
thus break badly at runtime.
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 a7fcd37c
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册