提交 b34b10a7 编写于 作者: K Kees Cook 提交者: Martin K. Petersen

scsi: bfa: use designated initializers

Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. This also initializes the
array members using the enum used to look up __port_action entries.
Signed-off-by: NKees Cook <keescook@chromium.org>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 7ecaeaff
...@@ -89,16 +89,27 @@ static struct { ...@@ -89,16 +89,27 @@ static struct {
void (*online) (struct bfa_fcs_lport_s *port); void (*online) (struct bfa_fcs_lport_s *port);
void (*offline) (struct bfa_fcs_lport_s *port); void (*offline) (struct bfa_fcs_lport_s *port);
} __port_action[] = { } __port_action[] = {
{ [BFA_FCS_FABRIC_UNKNOWN] = {
bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online, .init = bfa_fcs_lport_unknown_init,
bfa_fcs_lport_unknown_offline}, { .online = bfa_fcs_lport_unknown_online,
bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online, .offline = bfa_fcs_lport_unknown_offline
bfa_fcs_lport_fab_offline}, { },
bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online, [BFA_FCS_FABRIC_SWITCHED] = {
bfa_fcs_lport_n2n_offline}, { .init = bfa_fcs_lport_fab_init,
bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online, .online = bfa_fcs_lport_fab_online,
bfa_fcs_lport_loop_offline}, .offline = bfa_fcs_lport_fab_offline
}; },
[BFA_FCS_FABRIC_N2N] = {
.init = bfa_fcs_lport_n2n_init,
.online = bfa_fcs_lport_n2n_online,
.offline = bfa_fcs_lport_n2n_offline
},
[BFA_FCS_FABRIC_LOOP] = {
.init = bfa_fcs_lport_loop_init,
.online = bfa_fcs_lport_loop_online,
.offline = bfa_fcs_lport_loop_offline
},
};
/* /*
* fcs_port_sm FCS logical port state machine * fcs_port_sm FCS logical port state machine
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册