diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-12-19 03:47:06 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-01-03 05:53:30 +0300 |
commit | a27747a207887420106aca284c0e98ba5e547d78 (patch) | |
tree | 7fe93e9ca26eebc770b3d1eba2817efa1c8480c3 /drivers/scsi/qla2xxx/qla_fw.h | |
parent | b3e3d4c618c5b97ca8aa12779df770782be83fb2 (diff) | |
download | linux-a27747a207887420106aca284c0e98ba5e547d78.tar.xz |
scsi: qla2xxx: Improve readability of the code that handles qla_flt_header
Declare qla_hw_data.flt as a qla_flt_header pointer instead of as a void
pointer. Add a zero-length array at the end of struct qla_flt_header to
make it clear that qla_flt_header and qla_flt_region are contiguous. This
patch removes several casts but does not change any functionality.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Link: https://lore.kernel.org/r/20191219004706.39039-1-bvanassche@acm.org
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_fw.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_fw.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index df5fff819bd7..d641918cdd46 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -1471,13 +1471,6 @@ struct qla_flt_location { uint16_t checksum; }; -struct qla_flt_header { - uint16_t version; - uint16_t length; - uint16_t checksum; - uint16_t unused; -}; - #define FLT_REG_FW 0x01 #define FLT_REG_BOOT_CODE 0x07 #define FLT_REG_VPD_0 0x14 @@ -1538,6 +1531,14 @@ struct qla_flt_region { uint32_t end; }; +struct qla_flt_header { + uint16_t version; + uint16_t length; + uint16_t checksum; + uint16_t unused; + struct qla_flt_region region[0]; +}; + #define FLT_REGION_SIZE 16 #define FLT_MAX_REGIONS 0xFF #define FLT_REGIONS_SIZE (FLT_REGION_SIZE * FLT_MAX_REGIONS) |