diff options
author | Kees Cook <keescook@chromium.org> | 2023-01-06 00:30:46 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-01-14 02:25:53 +0100 |
commit | 64b6deadc938b37717aa1338715cb7ef5e7d444c (patch) | |
tree | d784bce4bf9e09c7681cc5468bfaf885ae1a16a0 /include/ufs | |
parent | scsi: mvumi: Replace 1-element arrays with flexible array members (diff) | |
download | linux-64b6deadc938b37717aa1338715cb7ef5e7d444c.tar.xz linux-64b6deadc938b37717aa1338715cb7ef5e7d444c.zip |
scsi: uapi: Replace 0-length array with flexible array
Zero-length arrays are deprecated[1]. Replace struct
fc_bsg_host_vendor_reply's "vendor_rsp" 0-length array with a flexible
array. Detected with GCC 13, using -fstrict-flex-arrays=3:
drivers/scsi/qla2xxx/qla_isr.c: In function 'qla25xx_process_bidir_status_iocb.isra':
drivers/scsi/qla2xxx/qla_isr.c:3117:54: warning: array subscript 0 is outside array bounds of '__u32[0]' {aka 'unsigned int[]'} [-Warray-bounds=]
3117 | bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = rval;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from drivers/scsi/qla2xxx/qla_def.h:34,
from drivers/scsi/qla2xxx/qla_isr.c:6:
include/uapi/scsi/scsi_bsg_fc.h:219:15: note: while referencing 'vendor_rsp'
219 | __u32 vendor_rsp[0];
| ^~~~~~~~~~
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20230105233042.never.913-kees@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/ufs')
0 files changed, 0 insertions, 0 deletions