Use passed parameter instead of calculating it again

Signed-off-by: Michal Čihař <michal@cihar.com>
Document optional parameter type

Signed-off-by: Michal Čihař <michal@cihar.com>
Remove unused parameter

Signed-off-by: Michal Čihař <michal@cihar.com>
Fix parameter type declaration

Signed-off-by: Michal Čihař <michal@cihar.com>