skd: Check structure sizes at build time
authorBart Van Assche <bart.vanassche@wdc.com>
Thu, 17 Aug 2017 20:13:08 +0000 (13:13 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 18 Aug 2017 14:45:29 +0000 (08:45 -0600)
This patch will help to verify the changes made by the next patch.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/skd_main.c

index 6ba6103f53ddf7400f35c6e3002dc6764f24ea9c..e2d205b58fe20d13834fb347c8d7998034db91b4 100644 (file)
@@ -4959,6 +4959,11 @@ static void skd_log_skreq(struct skd_device *skdev,
 
 static int __init skd_init(void)
 {
+       BUILD_BUG_ON(sizeof(struct fit_completion_entry_v1) != 8);
+       BUILD_BUG_ON(sizeof(struct fit_comp_error_info) != 32);
+       BUILD_BUG_ON(sizeof(struct skd_command_header) != 16);
+       BUILD_BUG_ON(sizeof(struct skd_scsi_request) != 32);
+       BUILD_BUG_ON(sizeof(struct driver_inquiry_data) != 44);
        BUILD_BUG_ON(offsetof(struct skd_msg_buf, fmh) != 0);
        BUILD_BUG_ON(offsetof(struct skd_msg_buf, scsi) != 64);
        BUILD_BUG_ON(sizeof(struct skd_msg_buf) != SKD_N_FITMSG_BYTES);