[misc] Remove useless code

(cherry picked from commit 580b40491525fbd43ed19a35e1531f30ab99352e)