lib: remove redundant code

remove the duplicate code

Signed-off-by: AceLan Kao <acelan@acelan.idv.tw>