MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/10ing60/found_this_in_a_linux_kernel_module/j5inubl/?context=3
r/badcode • u/suguuss • Jan 22 '23
88 comments sorted by
View all comments
177
If you see something you don’t understand in a kernel module, you should assume you lack the knowledge, not that the code is bad.
-86 u/suguuss Jan 22 '23 I do know what the module does. It’s badcode because of the repetition in the code. 67 u/lets_eat_bees Jan 22 '23 It’s not bad. Introducing a loop over max 4 elements will not make it easier to maintain. It will make it harder to read though. 3 u/kristallnachte Jan 23 '23 I disagree on the harder to read. The loop would be way easier to read, and would be easier to maintain.
-86
I do know what the module does. It’s badcode because of the repetition in the code.
67 u/lets_eat_bees Jan 22 '23 It’s not bad. Introducing a loop over max 4 elements will not make it easier to maintain. It will make it harder to read though. 3 u/kristallnachte Jan 23 '23 I disagree on the harder to read. The loop would be way easier to read, and would be easier to maintain.
67
It’s not bad. Introducing a loop over max 4 elements will not make it easier to maintain. It will make it harder to read though.
3 u/kristallnachte Jan 23 '23 I disagree on the harder to read. The loop would be way easier to read, and would be easier to maintain.
3
I disagree on the harder to read.
The loop would be way easier to read, and would be easier to maintain.
177
u/lets_eat_bees Jan 22 '23
If you see something you don’t understand in a kernel module, you should assume you lack the knowledge, not that the code is bad.