On the Davis inequality in Banach function spaces