Commit b0a9e2c
netconsole: Create a allocation helper
De-duplicate the initialization and allocation code for struct
netconsole_target.
The same allocation and initialization code is duplicated in two
different places in the netconsole subsystem, when the netconsole target
is initialized by command line parameters (alloc_param_target()), and
dynamically by sysfs (make_netconsole_target()).
Create a helper function, and call it from the two different functions.
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20230811093158.1678322-2-leitao@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent f3add6d commit b0a9e2c
1 file changed
Lines changed: 23 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
172 | 174 | | |
173 | | - | |
174 | 175 | | |
175 | 176 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 177 | | |
181 | 178 | | |
182 | | - | |
| 179 | + | |
183 | 180 | | |
184 | 181 | | |
185 | 182 | | |
186 | 183 | | |
187 | 184 | | |
188 | 185 | | |
189 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
190 | 202 | | |
191 | 203 | | |
192 | 204 | | |
| |||
195 | 207 | | |
196 | 208 | | |
197 | 209 | | |
| 210 | + | |
198 | 211 | | |
199 | 212 | | |
200 | 213 | | |
| |||
664 | 677 | | |
665 | 678 | | |
666 | 679 | | |
667 | | - | |
668 | 680 | | |
| 681 | + | |
669 | 682 | | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
| 683 | + | |
675 | 684 | | |
676 | 685 | | |
677 | 686 | | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | 687 | | |
685 | 688 | | |
686 | 689 | | |
| |||
0 commit comments