[PATCH 3/3] storage/util: replace unnecessary while loop by if