Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: pm80xx: Avoid -Wflex-array-member-not-at-end warnings

Comment out unused field 'residual_count' in a couple of structures, and
with this, fix the following -Wflex-array-member-not-at-end warnings:

drivers/scsi/pm8001/pm8001_hwi.h:342:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/scsi/pm8001/pm80xx_hwi.h:561:32: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Gustavo A. R. Silva and committed by
Martin K. Petersen
508e754c 3126b5fd

+6 -2
+3 -1
drivers/scsi/pm8001/pm8001_hwi.h
··· 339 339 __le32 status; 340 340 __le32 param; 341 341 __le32 ssptag_rescv_rescpad; 342 + 343 + /* Must be last --ends in a flexible-array member. */ 342 344 struct ssp_response_iu ssp_resp_iu; 343 - __le32 residual_count; 345 + /* __le32 residual_count; */ 344 346 } __attribute__((packed, aligned(4))); 345 347 346 348
+3 -1
drivers/scsi/pm8001/pm80xx_hwi.h
··· 558 558 __le32 status; 559 559 __le32 param; 560 560 __le32 ssptag_rescv_rescpad; 561 + 562 + /* Must be last --ends in a flexible-array member. */ 561 563 struct ssp_response_iu ssp_resp_iu; 562 - __le32 residual_count; 564 + /* __le32 residual_count; */ 563 565 } __attribute__((packed, aligned(4))); 564 566 565 567 #define SSP_RESCV_BIT 0x00010000