One idea about kbd_pt_regs. Only one function, fn_show_ptregs, uses kbd_pt_regs. Instaed of passing reg data around wouldn't be better to just remove fn_show_ptregs from the FN_HANDLERS and call it independently inside of kbd_keycode instead.