Skip to content

Commit d872023

Browse files
committed
scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops
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: 035f7f8 ("randstruct: Enable Clang support") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent 82d76bf commit d872023

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/qedf/qedf_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static u32 qedf_get_login_failures(void *cookie)
699699
}
700700

701701
static struct qed_fcoe_cb_ops qedf_cb_ops = {
702-
{
702+
.common = {
703703
.link_update = qedf_link_update,
704704
.bw_update = qedf_bw_update,
705705
.schedule_recovery_handler = qedf_schedule_recovery_handler,

0 commit comments

Comments
 (0)