From: Kees Cook Date: Fri, 2 May 2025 22:41:57 +0000 (-0700) Subject: scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops X-Git-Tag: v5.10.239~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85d7a81b968ad8061df5e7f3e8c884f96763caa0;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 912845415d9b4..22b0bfc3f055d 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -692,7 +692,7 @@ static u32 qedf_get_login_failures(void *cookie) } static struct qed_fcoe_cb_ops qedf_cb_ops = { - { + .common = { .link_update = qedf_link_update, .bw_update = qedf_bw_update, .schedule_recovery_handler = qedf_schedule_recovery_handler,