Commit 442d68eb authored by Alex Elder's avatar Alex Elder Committed by David S. Miller
Browse files

net: ipa: kill the remaining conditional validation code



There are only a few remaining spots that validate IPA code
conditional on whether a symbol is defined at compile time.
The checks are not expensive, so just build them always.

This completes the removal of all CONFIG_VALIDATE/CONFIG_VALIDATION
IPA code.

Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 546948bf
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
# Un-comment the next line if you want to validate configuration data
#ccflags-y		+=	-DIPA_VALIDATE

obj-$(CONFIG_QCOM_IPA)	+=	ipa.o

ipa-y			:=	ipa_main.o ipa_clock.o ipa_reg.o ipa_mem.o \
+0 −2
Original line number Diff line number Diff line
@@ -1964,7 +1964,6 @@ static void gsi_evt_ring_init(struct gsi *gsi)
static bool gsi_channel_data_valid(struct gsi *gsi,
				   const struct ipa_gsi_endpoint_data *data)
{
#ifdef IPA_VALIDATION
	u32 channel_id = data->channel_id;
	struct device *dev = gsi->dev;

@@ -2010,7 +2009,6 @@ static bool gsi_channel_data_valid(struct gsi *gsi,
			channel_id, data->channel.event_count);
		return false;
	}
#endif /* IPA_VALIDATION */

	return true;
}
+0 −4
Original line number Diff line number Diff line
@@ -90,14 +90,12 @@ int gsi_trans_pool_init(struct gsi_trans_pool *pool, size_t size, u32 count,
{
	void *virt;

#ifdef IPA_VALIDATE
	if (!size)
		return -EINVAL;
	if (count < max_alloc)
		return -EINVAL;
	if (!max_alloc)
		return -EINVAL;
#endif /* IPA_VALIDATE */

	/* By allocating a few extra entries in our pool (one less
	 * than the maximum number that will be requested in a
@@ -140,14 +138,12 @@ int gsi_trans_pool_init_dma(struct device *dev, struct gsi_trans_pool *pool,
	dma_addr_t addr;
	void *virt;

#ifdef IPA_VALIDATE
	if (!size)
		return -EINVAL;
	if (count < max_alloc)
		return -EINVAL;
	if (!max_alloc)
		return -EINVAL;
#endif /* IPA_VALIDATE */

	/* Don't let allocations cross a power-of-two boundary */
	size = __roundup_pow_of_two(size);
+0 −3
Original line number Diff line number Diff line
@@ -207,8 +207,6 @@ bool ipa_cmd_table_valid(struct ipa *ipa, const struct ipa_mem *mem, bool route)
	return true;
}

#ifdef IPA_VALIDATE

/* Validate the memory region that holds headers */
static bool ipa_cmd_header_valid(struct ipa *ipa)
{
@@ -343,7 +341,6 @@ bool ipa_cmd_data_valid(struct ipa *ipa)
	return true;
}

#endif /* IPA_VALIDATE */

int ipa_cmd_pool_init(struct gsi_channel *channel, u32 tre_max)
{
+0 −11
Original line number Diff line number Diff line
@@ -68,8 +68,6 @@ struct ipa_cmd_info {
bool ipa_cmd_table_valid(struct ipa *ipa, const struct ipa_mem *mem,
			    bool route);

#ifdef IPA_VALIDATE

/**
 * ipa_cmd_data_valid() - Validate command-realted configuration is valid
 * @ipa:	- IPA pointer
@@ -78,15 +76,6 @@ bool ipa_cmd_table_valid(struct ipa *ipa, const struct ipa_mem *mem,
 */
bool ipa_cmd_data_valid(struct ipa *ipa);

#else /* !IPA_VALIDATE */

static inline bool ipa_cmd_data_valid(struct ipa *ipa)
{
	return true;
}

#endif /* !IPA_VALIDATE */

/**
 * ipa_cmd_pool_init() - initialize command channel pools
 * @channel:	AP->IPA command TX GSI channel pointer
Loading