Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b34b10a7 authored by Kees Cook's avatar Kees Cook Committed by Martin K. Petersen
Browse files

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: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 7ecaeaff
Loading
Loading
Loading
Loading
+21 −10
Original line number Diff line number Diff line
@@ -89,15 +89,26 @@ static struct {
	void		(*online) (struct bfa_fcs_lport_s *port);
	void		(*offline) (struct bfa_fcs_lport_s *port);
} __port_action[] = {
	{
	bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
			bfa_fcs_lport_unknown_offline}, {
	bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
			bfa_fcs_lport_fab_offline}, {
	bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
			bfa_fcs_lport_n2n_offline}, {
	bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
			bfa_fcs_lport_loop_offline},
	[BFA_FCS_FABRIC_UNKNOWN] = {
		.init = bfa_fcs_lport_unknown_init,
		.online = bfa_fcs_lport_unknown_online,
		.offline = bfa_fcs_lport_unknown_offline
	},
	[BFA_FCS_FABRIC_SWITCHED] = {
		.init = bfa_fcs_lport_fab_init,
		.online = bfa_fcs_lport_fab_online,
		.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
	},
};

/*