return 0;
 }
 
-#ifdef IPA_VALIDATE
-
-static bool ipa_mem_valid(struct ipa *ipa, enum ipa_mem_id mem_id)
+static bool ipa_mem_valid(struct ipa *ipa, const struct ipa_mem *mem)
 {
-       const struct ipa_mem *mem = &ipa->mem[mem_id];
        struct device *dev = &ipa->pdev->dev;
+       enum ipa_mem_id mem_id = mem->id;
        u16 size_multiple;
 
        /* Other than modem memory, sizes must be a multiple of 8 */
        return false;
 }
 
-#else /* !IPA_VALIDATE */
-
-static bool ipa_mem_valid(struct ipa *ipa, enum ipa_mem_id mem_id)
-{
-       return true;
-}
-
-#endif /*! IPA_VALIDATE */
-
 /**
  * ipa_mem_config() - Configure IPA shared memory
  * @ipa:       IPA pointer
                __le32 *canary;
 
                /* Validate all regions (even undefined ones) */
-               if (!ipa_mem_valid(ipa, mem_id))
+               if (!ipa_mem_valid(ipa, mem))
                        goto err_dma_free;
 
                /* Skip over undefined regions */