moduzlib: Fix fn prototype and some code style; use it in stmhal port.