[PATCH v2 0/2] remove workarounds for gcc bug wrt unnamed fields in initializers
From: Niklas Cassel
Date: Thu Jun 18 2020 - 16:02:43 EST
Make the nvme code more uniform by initializing struct members at
declaration time. This change is done both in drivers/nvme/host/ and
drivers/nvme/target/.
This is how the design pattern was in nvme, before workarounds for a gcc
bug were introduced in commit e44ac588cd61 ("drivers/block/nvme-core.c:
fix build with gcc-4.4.4").
Since the minimum gcc version needed to build the kernel is now gcc 4.8.0,
which does not have this bug, revert to the previous design pattern,
which matches how the rest of the nvme code handles initialization
of struct members (excluding the cases where anonymous unions were
involved).
If, for some reason, we want to allow builds with gcc < 4.6.0
even though the minimum gcc version is now 4.8.0,
there is another less intrusive workaround where you add an extra pair of
curly braces, see e.g. commit 6cc65be4f6f2 ("locking/qspinlock: Fix build
for anonymous union in older GCC compilers").
Changes since v1:
-Fixed RDMA build error.
Niklas Cassel (2):
nvme: remove workarounds for gcc bug wrt unnamed fields in
initializers
nvmet: remove workarounds for gcc bug wrt unnamed fields in
initializers
drivers/nvme/host/core.c | 59 ++++++++++++++++++------------------
drivers/nvme/host/lightnvm.c | 32 +++++++++----------
drivers/nvme/host/rdma.c | 28 ++++++++---------
drivers/nvme/target/rdma.c | 23 +++++++-------
4 files changed, 71 insertions(+), 71 deletions(-)
--
2.26.2