diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-10-20 14:40:23 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-10-26 23:24:50 -0400 |
commit | 9a868c8ad3f467fe3487e3d96fc0e2f3c90f34f9 (patch) | |
tree | 636ea7635c6ab9cdd096b7495dc9a1b061d16c6b /drivers/scsi/ufs/ufshcd.c | |
parent | 3ad317a1f932f3dfdedfba405f7b2d02154e20e1 (diff) |
scsi: ufs: core: Add a compile-time structure size check
Before modifying struct ufshcd_sg_entry, add a compile-time structure size
check.
Link: https://lore.kernel.org/r/20211020214024.2007615-10-bvanassche@acm.org
Acked-by: Avri Altman <Avri.Altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.c')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 7ea0588247b0..dde4d3f607f2 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -9791,6 +9791,11 @@ static int __init ufshcd_core_init(void) { int ret; + /* Verify that there are no gaps in struct utp_transfer_cmd_desc. */ + static_assert(sizeof(struct utp_transfer_cmd_desc) == + 2 * ALIGNED_UPIU_SIZE + + SG_ALL * sizeof(struct ufshcd_sg_entry)); + ufs_debugfs_init(); ret = scsi_register_driver(&ufs_dev_wlun_template.gendrv); |