helper function
also: utility function, subroutine, auxiliary function
A smaller, reusable function that performs a specific task and is called by other functions to reduce code duplication and improve maintainability.
A helper function is a programming construct that encapsulates a narrow, well-defined operation and is designed to be called repeatedly by other functions in the same program or library. Helper functions promote cleaner code by eliminating redundancy and making complex logic easier to understand and maintain.
In Linux kernel and system programming, helper functions are common throughout the codebase. For example, a helper function might validate user input, format data, or perform a calculation that multiple other functions need. A typical example: a validate_path() helper might be called by several system calls rather than duplicating path-checking logic in each one.
Helper functions differ from utility functions mainly in scope—helpers are often internal to a module, while utilities are broader. When you read kernel source like fs/namei.c, you'll see many small static helper functions supporting the main path-resolution logic.