c
static int qca_generate_hsp_nvm_name(char *buf, size_t size, 
                                      struct qca_btsoc_version ver, 
                                      u8 rom_ver, u16 boardid) {

    // Validate inputs to ensure they are within reasonable bounds.
    if (rom_ver > MAX_ROM_VER || boardid > MAX_BOARD_ID) {
        return -EINVAL; // Or another appropriate error code
    }

    // ... (rest of the filename generation logic) ...
}
