[U-Boot] [PATCH v4 06/29] env: common: Factor out the common env_valid check