src: upstream cleanup from ac5e24b49172147