Commit c9a5baf
scsi: sssraid: Replace zero-length array with flexible array member
Replace the zero-length array 'event_data[0]' with a C99 flexible array
member 'event_data[]' in struct sssraid_fwevt.
Zero-length arrays are a GNU extension that predates C99 flexible array
members. The kernel's fortify-string checks treat zero-length arrays as
having size 0, which causes false-positive warnings when memcpy() is used
to copy data into them:
In function 'fortify_memcpy_chk',
inlined from 'sssraid_process_admin_cq.isra' at
drivers/scsi/sssraid/sssraid_fw.c:1574:3:
./include/linux/fortify-string.h:597:25: error: call to
'__write_overflow_field' declared with attribute warning: detected
write beyond size of field (1st parameter); maybe use struct_group()?
This is part of the ongoing effort to replace all zero-length arrays with
flexible array members, as recommended by the kernel coding style.
Link: KSPP/linux#78
Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>1 parent e20d8c8 commit c9a5baf
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
0 commit comments