OSDN Git Service

vfio-pci/nvlink2: Fix ancient gcc warnings
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 23 Jan 2019 04:07:11 +0000 (15:07 +1100)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 23 Jan 2019 15:20:43 +0000 (08:20 -0700)
commit9a71ac7e15a723e90fc40388b4b92eefaabf747c
tree2c867dd964de4b13f97ea137cf57a5d66e070cca
parent33e5ee780e37bcf494013e2497580b00b7676507
vfio-pci/nvlink2: Fix ancient gcc warnings

Using the {0} construct as a generic initializer is perfectly fine in C,
however due to a bug in old gcc there is a warning:

  + /kisskb/src/drivers/vfio/pci/vfio_pci_nvlink2.c: warning: (near
initialization for 'cap.header') [-Wmissing-braces]:  => 181:9

Since for whatever reason we still want to compile the modern kernel
with such an old gcc without warnings, this changes the capabilities
initialization.

The gcc bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

Fixes: 7f92891778df ("vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver")
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_nvlink2.c