OpenCloudOS-Kernel/drivers/block
Gustavo A. R. Silva 431d6e3eec rsxx: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertenly introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 7649773293 ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-19 15:26:45 -06:00
..
aoe block: aoe: Use scnprintf() for avoiding potential buffer overflow 2020-03-12 07:39:04 -06:00
drbd block/drbd: delete invalid function drbd_md_mark_dirty_ 2020-03-12 07:49:09 -06:00
mtip32xx
paride scsi: compat_ioctl: cdrom: Replace .ioctl with .compat_ioctl in four appropriate places 2020-02-24 15:06:07 -05:00
rsxx rsxx: Replace zero-length array with flexible-array member 2020-03-19 15:26:45 -06:00
xen-blkback xen/blkback: Consistently insert one empty line between functions 2020-01-29 07:35:49 -06:00
zram drivers/block/zram/zram_drv.c: fix error return codes not being returned in writeback_store 2020-01-31 10:30:39 -08:00
Kconfig virtio-blk: remove VIRTIO_BLK_F_SCSI support 2020-02-06 03:40:26 -05:00
Makefile
amiflop.c
ataflop.c ataflop: Remove unneeded semicolon 2019-11-28 10:40:47 -07:00
brd.c brd: check and limit max_part par 2020-02-04 07:19:33 -07:00
cryptoloop.c
floppy.c floppy: rename the global "fdc" variable to "current_fdc" 2020-03-16 08:26:58 -06:00
loop.c loop: Only freeze block queue when needed. 2020-03-10 14:10:43 -06:00
loop.h
nbd.c nbd: requeue command if the soecket is changed 2020-03-12 08:01:24 -06:00
null_blk.h null_blk: remove unused fields in 'nullb_cmd' 2020-02-25 09:43:29 -07:00
null_blk_main.c null_blk: describe the usage of fault injection param 2020-03-12 18:54:28 -06:00
null_blk_zoned.c null_blk: Fix zone write handling 2020-01-15 08:18:39 -07:00
pktcdvd.c compat_ioctl: cdrom: handle CDROM_LAST_WRITTEN 2020-01-03 09:33:11 +01:00
ps3disk.c
ps3vram.c
rbd.c Merge branch 'merge.nfs-fs_parse.1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-02-08 13:26:41 -08:00
rbd_types.h
skd_main.c
skd_s1120.h
sunvdc.c compat_ioctl: block: handle cdrom compat ioctl in non-cdrom drivers 2020-01-03 09:33:15 +01:00
swim.c
swim3.c
swim_asm.S
sx8.c
umem.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
umem.h
virtio_blk.c virtio-blk: remove VIRTIO_BLK_F_SCSI support 2020-02-06 03:40:26 -05:00
xen-blkfront.c xen/blkfront: fix ring info addressing 2020-03-05 09:55:01 -06:00
xsysace.c
z2ram.c