[PATCH 008/117] fc: Add a compile-time structure size check

Bart Van Assche
2021-04-20T00:09:04Z

Before changing the definition of struct fc_bsg_reply, add a compile-time
structure size check.

Cc: James Smart <james.smart@broadcom.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/scsi/scsi_transport_fc.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index da5b503dc7a1..2d4db2ae45db 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -948,6 +948,8 @@ static __init int fc_transport_init(void)
{
int error;

+ BUILD_BUG_ON(offsetof(struct fc_bsg_reply, reply_data) != 8);
+
atomic_set(&fc_event_seq, 0);

error = transport_class_register(&fc_host_class);