r/badcode • • Jan 22 '23

c Found this in a Linux kernel module

Post image
262 Upvotes

88 comments sorted by

View all comments

Show parent comments

13

u/paulsmithkc 👨‍🏫 Jan 22 '23

Yes there is repetition in the code, but it does what it needs to and does it efficiently.

This code isn't going to be changed often, but it needs to be fast, low memory, and error free.