public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] remove workarounds for gcc bug wrt unnamed fields in initializers
@ 2020-06-18 20:02 Niklas Cassel
  2020-06-18 20:02 ` [PATCH v2 1/2] nvme: " Niklas Cassel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Niklas Cassel @ 2020-06-18 20:02 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni
  Cc: Niklas Cassel, linux-nvme, linux-kernel

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-25 11:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-18 20:02 [PATCH v2 0/2] remove workarounds for gcc bug wrt unnamed fields in initializers Niklas Cassel
2020-06-18 20:02 ` [PATCH v2 1/2] nvme: " Niklas Cassel
2020-06-18 20:02 ` [PATCH v2 2/2] nvmet: " Niklas Cassel
2020-06-24 16:44 ` [PATCH v2 0/2] " Christoph Hellwig
2020-06-24 16:57   ` Niklas Cassel
2020-06-24 17:02     ` Christoph Hellwig
2020-06-24 17:08       ` Niklas Cassel
2020-06-24 22:40   ` Chaitanya Kulkarni
2020-06-25 11:10     ` Niklas Cassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox