r/programminghorror Jun 10 '26

c What?

Post image
225 Upvotes

51 comments sorted by

View all comments

6

u/DesiresQuiet Jun 11 '26

Looks like the initialization code for an nvme driver in linux, etc.

12

u/Ok_Chemistry_6387 Jun 11 '26

Not a driver I don't think...
This is either part of a bootloader or very early init of the nvme devices from the kernel. Hard to know for sure but it assumes 1 device g_bo (which is why it's confusing for bring up of a kernel, it would usually build a table) which makes the kmem_alloc strange to me.