]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops
authorKees Cook <kees@kernel.org>
Fri, 2 May 2025 22:41:57 +0000 (15:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:38 +0000 (11:05 +0100)
commite3ff9f86cdb7b6b8d3bd7c73b7a413768dfc186c
tree011fcdbd61c0d99c1884e40a2d11fd9a390f032a
parent8e31c6cc3cbac1d05cdca6e9c3c74653dd90a091
scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops

commit d8720235d5b5cad86c1f07f65117ef2a96f8bec7 upstream.

Recent fixes to the randstruct GCC plugin allowed it to notice
that this structure is entirely function pointers and is therefore
subject to randomization, but doing so requires that it always use
designated initializers. Explicitly specify the "common" member as being
initialized. Silences:

drivers/scsi/qedf/qedf_main.c:702:9: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
  702 |         {
      |         ^

Fixes: 035f7f87b729 ("randstruct: Enable Clang support")
Link: https://lore.kernel.org/r/20250502224156.work.617-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qedf/qedf_main.c