aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/lmc
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-12-16 19:59:18 -0500
committerDavid S. Miller <davem@davemloft.net>2016-12-17 11:56:57 -0500
commitaabd7ad949247ef315fa5086d2caad7885567434 (patch)
tree44ef9260fba895f65314625e4329de8d296d81df /drivers/net/wan/lmc
parent9d1c0ca5e1d6697ce1e32bb708bfe24dff34f287 (diff)
WAN: use designated initializers
Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/lmc')
-rw-r--r--drivers/net/wan/lmc/lmc_media.c97
1 files changed, 49 insertions, 48 deletions
diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
index 5920c996fcdf..ff2e4a5654c7 100644
--- a/drivers/net/wan/lmc/lmc_media.c
+++ b/drivers/net/wan/lmc/lmc_media.c
@@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
95static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32); 95static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
96 96
97lmc_media_t lmc_ds3_media = { 97lmc_media_t lmc_ds3_media = {
98 lmc_ds3_init, /* special media init stuff */ 98 .init = lmc_ds3_init, /* special media init stuff */
99 lmc_ds3_default, /* reset to default state */ 99 .defaults = lmc_ds3_default, /* reset to default state */
100 lmc_ds3_set_status, /* reset status to state provided */ 100 .set_status = lmc_ds3_set_status, /* reset status to state provided */
101 lmc_dummy_set_1, /* set clock source */ 101 .set_clock_source = lmc_dummy_set_1, /* set clock source */
102 lmc_dummy_set2_1, /* set line speed */ 102 .set_speed = lmc_dummy_set2_1, /* set line speed */
103 lmc_ds3_set_100ft, /* set cable length */ 103 .set_cable_length = lmc_ds3_set_100ft, /* set cable length */
104 lmc_ds3_set_scram, /* set scrambler */ 104 .set_scrambler = lmc_ds3_set_scram, /* set scrambler */
105 lmc_ds3_get_link_status, /* get link status */ 105 .get_link_status = lmc_ds3_get_link_status, /* get link status */
106 lmc_dummy_set_1, /* set link status */ 106 .set_link_status = lmc_dummy_set_1, /* set link status */
107 lmc_ds3_set_crc_length, /* set CRC length */ 107 .set_crc_length = lmc_ds3_set_crc_length, /* set CRC length */
108 lmc_dummy_set_1, /* set T1 or E1 circuit type */ 108 .set_circuit_type = lmc_dummy_set_1, /* set T1 or E1 circuit type */
109 lmc_ds3_watchdog 109 .watchdog = lmc_ds3_watchdog
110}; 110};
111 111
112lmc_media_t lmc_hssi_media = { 112lmc_media_t lmc_hssi_media = {
113 lmc_hssi_init, /* special media init stuff */ 113 .init = lmc_hssi_init, /* special media init stuff */
114 lmc_hssi_default, /* reset to default state */ 114 .defaults = lmc_hssi_default, /* reset to default state */
115 lmc_hssi_set_status, /* reset status to state provided */ 115 .set_status = lmc_hssi_set_status, /* reset status to state provided */
116 lmc_hssi_set_clock, /* set clock source */ 116 .set_clock_source = lmc_hssi_set_clock, /* set clock source */
117 lmc_dummy_set2_1, /* set line speed */ 117 .set_speed = lmc_dummy_set2_1, /* set line speed */
118 lmc_dummy_set_1, /* set cable length */ 118 .set_cable_length = lmc_dummy_set_1, /* set cable length */
119 lmc_dummy_set_1, /* set scrambler */ 119 .set_scrambler = lmc_dummy_set_1, /* set scrambler */
120 lmc_hssi_get_link_status, /* get link status */ 120 .get_link_status = lmc_hssi_get_link_status, /* get link status */
121 lmc_hssi_set_link_status, /* set link status */ 121 .set_link_status = lmc_hssi_set_link_status, /* set link status */
122 lmc_hssi_set_crc_length, /* set CRC length */ 122 .set_crc_length = lmc_hssi_set_crc_length, /* set CRC length */
123 lmc_dummy_set_1, /* set T1 or E1 circuit type */ 123 .set_circuit_type = lmc_dummy_set_1, /* set T1 or E1 circuit type */
124 lmc_hssi_watchdog 124 .watchdog = lmc_hssi_watchdog
125}; 125};
126 126
127lmc_media_t lmc_ssi_media = { lmc_ssi_init, /* special media init stuff */ 127lmc_media_t lmc_ssi_media = {
128 lmc_ssi_default, /* reset to default state */ 128 .init = lmc_ssi_init, /* special media init stuff */
129 lmc_ssi_set_status, /* reset status to state provided */ 129 .defaults = lmc_ssi_default, /* reset to default state */
130 lmc_ssi_set_clock, /* set clock source */ 130 .set_status = lmc_ssi_set_status, /* reset status to state provided */
131 lmc_ssi_set_speed, /* set line speed */ 131 .set_clock_source = lmc_ssi_set_clock, /* set clock source */
132 lmc_dummy_set_1, /* set cable length */ 132 .set_speed = lmc_ssi_set_speed, /* set line speed */
133 lmc_dummy_set_1, /* set scrambler */ 133 .set_cable_length = lmc_dummy_set_1, /* set cable length */
134 lmc_ssi_get_link_status, /* get link status */ 134 .set_scrambler = lmc_dummy_set_1, /* set scrambler */
135 lmc_ssi_set_link_status, /* set link status */ 135 .get_link_status = lmc_ssi_get_link_status, /* get link status */
136 lmc_ssi_set_crc_length, /* set CRC length */ 136 .set_link_status = lmc_ssi_set_link_status, /* set link status */
137 lmc_dummy_set_1, /* set T1 or E1 circuit type */ 137 .set_crc_length = lmc_ssi_set_crc_length, /* set CRC length */
138 lmc_ssi_watchdog 138 .set_circuit_type = lmc_dummy_set_1, /* set T1 or E1 circuit type */
139 .watchdog = lmc_ssi_watchdog
139}; 140};
140 141
141lmc_media_t lmc_t1_media = { 142lmc_media_t lmc_t1_media = {
142 lmc_t1_init, /* special media init stuff */ 143 .init = lmc_t1_init, /* special media init stuff */
143 lmc_t1_default, /* reset to default state */ 144 .defaults = lmc_t1_default, /* reset to default state */
144 lmc_t1_set_status, /* reset status to state provided */ 145 .set_status = lmc_t1_set_status, /* reset status to state provided */
145 lmc_t1_set_clock, /* set clock source */ 146 .set_clock_source = lmc_t1_set_clock, /* set clock source */
146 lmc_dummy_set2_1, /* set line speed */ 147 .set_speed = lmc_dummy_set2_1, /* set line speed */
147 lmc_dummy_set_1, /* set cable length */ 148 .set_cable_length = lmc_dummy_set_1, /* set cable length */
148 lmc_dummy_set_1, /* set scrambler */ 149 .set_scrambler = lmc_dummy_set_1, /* set scrambler */
149 lmc_t1_get_link_status, /* get link status */ 150 .get_link_status = lmc_t1_get_link_status, /* get link status */
150 lmc_dummy_set_1, /* set link status */ 151 .set_link_status = lmc_dummy_set_1, /* set link status */
151 lmc_t1_set_crc_length, /* set CRC length */ 152 .set_crc_length = lmc_t1_set_crc_length, /* set CRC length */
152 lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */ 153 .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
153 lmc_t1_watchdog 154 .watchdog = lmc_t1_watchdog
154}; 155};
155 156
156static void 157static void