Commit bb2cc7d7 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'net-ipa-fix-some-new-build-warnings'

Alex Elder says:

====================
net: ipa: fix some new build warnings

I got a super friendly message from the Intel kernel test robot that
pointed out that two patches I posted last week caused new build
warnings.  I already had these problems fixed in my own tree but
the fix was not included in what I sent out last week.
====================

Link: https://lore.kernel.org/r/20201226213737.338928-1-elder@linaro.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents bc4adf0e 1ddf776b
Loading
Loading
Loading
Loading
+13 −25
Original line number Diff line number Diff line
@@ -326,7 +326,7 @@ gsi_evt_ring_state(struct gsi *gsi, u32 evt_ring_id)
}

/* Issue an event ring command and wait for it to complete */
static int evt_ring_command(struct gsi *gsi, u32 evt_ring_id,
static void evt_ring_command(struct gsi *gsi, u32 evt_ring_id,
			     enum gsi_evt_cmd_opcode opcode)
{
	struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
@@ -361,19 +361,16 @@ static int evt_ring_command(struct gsi *gsi, u32 evt_ring_id,
	iowrite32(0, gsi->virt + GSI_CNTXT_SRC_EV_CH_IRQ_MSK_OFFSET);

	if (success)
		return 0;
		return;

	dev_err(dev, "GSI command %u for event ring %u timed out, state %u\n",
		opcode, evt_ring_id, evt_ring->state);

	return -ETIMEDOUT;
}

/* Allocate an event ring in NOT_ALLOCATED state */
static int gsi_evt_ring_alloc_command(struct gsi *gsi, u32 evt_ring_id)
{
	struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
	int ret;

	/* Get initial event ring state */
	evt_ring->state = gsi_evt_ring_state(gsi, evt_ring_id);
@@ -383,7 +380,7 @@ static int gsi_evt_ring_alloc_command(struct gsi *gsi, u32 evt_ring_id)
		return -EINVAL;
	}

	ret = evt_ring_command(gsi, evt_ring_id, GSI_EVT_ALLOCATE);
	evt_ring_command(gsi, evt_ring_id, GSI_EVT_ALLOCATE);

	/* If successful the event ring state will have changed */
	if (evt_ring->state == GSI_EVT_RING_STATE_ALLOCATED)
@@ -400,7 +397,6 @@ static void gsi_evt_ring_reset_command(struct gsi *gsi, u32 evt_ring_id)
{
	struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
	enum gsi_evt_ring_state state = evt_ring->state;
	int ret;

	if (state != GSI_EVT_RING_STATE_ALLOCATED &&
	    state != GSI_EVT_RING_STATE_ERROR) {
@@ -409,7 +405,7 @@ static void gsi_evt_ring_reset_command(struct gsi *gsi, u32 evt_ring_id)
		return;
	}

	ret = evt_ring_command(gsi, evt_ring_id, GSI_EVT_RESET);
	evt_ring_command(gsi, evt_ring_id, GSI_EVT_RESET);

	/* If successful the event ring state will have changed */
	if (evt_ring->state == GSI_EVT_RING_STATE_ALLOCATED)
@@ -423,7 +419,6 @@ static void gsi_evt_ring_reset_command(struct gsi *gsi, u32 evt_ring_id)
static void gsi_evt_ring_de_alloc_command(struct gsi *gsi, u32 evt_ring_id)
{
	struct gsi_evt_ring *evt_ring = &gsi->evt_ring[evt_ring_id];
	int ret;

	if (evt_ring->state != GSI_EVT_RING_STATE_ALLOCATED) {
		dev_err(gsi->dev, "event ring %u state %u before dealloc\n",
@@ -431,7 +426,7 @@ static void gsi_evt_ring_de_alloc_command(struct gsi *gsi, u32 evt_ring_id)
		return;
	}

	ret = evt_ring_command(gsi, evt_ring_id, GSI_EVT_DE_ALLOC);
	evt_ring_command(gsi, evt_ring_id, GSI_EVT_DE_ALLOC);

	/* If successful the event ring state will have changed */
	if (evt_ring->state == GSI_EVT_RING_STATE_NOT_ALLOCATED)
@@ -454,7 +449,7 @@ static enum gsi_channel_state gsi_channel_state(struct gsi_channel *channel)
}

/* Issue a channel command and wait for it to complete */
static int
static void
gsi_channel_command(struct gsi_channel *channel, enum gsi_ch_cmd_opcode opcode)
{
	struct completion *completion = &channel->completion;
@@ -489,12 +484,10 @@ gsi_channel_command(struct gsi_channel *channel, enum gsi_ch_cmd_opcode opcode)
	iowrite32(0, gsi->virt + GSI_CNTXT_SRC_CH_IRQ_MSK_OFFSET);

	if (success)
		return 0;
		return;

	dev_err(dev, "GSI command %u for channel %u timed out, state %u\n",
		opcode, channel_id, gsi_channel_state(channel));

	return -ETIMEDOUT;
}

/* Allocate GSI channel in NOT_ALLOCATED state */
@@ -503,7 +496,6 @@ static int gsi_channel_alloc_command(struct gsi *gsi, u32 channel_id)
	struct gsi_channel *channel = &gsi->channel[channel_id];
	struct device *dev = gsi->dev;
	enum gsi_channel_state state;
	int ret;

	/* Get initial channel state */
	state = gsi_channel_state(channel);
@@ -513,7 +505,7 @@ static int gsi_channel_alloc_command(struct gsi *gsi, u32 channel_id)
		return -EINVAL;
	}

	ret = gsi_channel_command(channel, GSI_CH_ALLOCATE);
	gsi_channel_command(channel, GSI_CH_ALLOCATE);

	/* If successful the channel state will have changed */
	state = gsi_channel_state(channel);
@@ -531,7 +523,6 @@ static int gsi_channel_start_command(struct gsi_channel *channel)
{
	struct device *dev = channel->gsi->dev;
	enum gsi_channel_state state;
	int ret;

	state = gsi_channel_state(channel);
	if (state != GSI_CHANNEL_STATE_ALLOCATED &&
@@ -541,7 +532,7 @@ static int gsi_channel_start_command(struct gsi_channel *channel)
		return -EINVAL;
	}

	ret = gsi_channel_command(channel, GSI_CH_START);
	gsi_channel_command(channel, GSI_CH_START);

	/* If successful the channel state will have changed */
	state = gsi_channel_state(channel);
@@ -559,7 +550,6 @@ static int gsi_channel_stop_command(struct gsi_channel *channel)
{
	struct device *dev = channel->gsi->dev;
	enum gsi_channel_state state;
	int ret;

	state = gsi_channel_state(channel);

@@ -576,7 +566,7 @@ static int gsi_channel_stop_command(struct gsi_channel *channel)
		return -EINVAL;
	}

	ret = gsi_channel_command(channel, GSI_CH_STOP);
	gsi_channel_command(channel, GSI_CH_STOP);

	/* If successful the channel state will have changed */
	state = gsi_channel_state(channel);
@@ -598,7 +588,6 @@ static void gsi_channel_reset_command(struct gsi_channel *channel)
{
	struct device *dev = channel->gsi->dev;
	enum gsi_channel_state state;
	int ret;

	msleep(1);	/* A short delay is required before a RESET command */

@@ -612,7 +601,7 @@ static void gsi_channel_reset_command(struct gsi_channel *channel)
		return;
	}

	ret = gsi_channel_command(channel, GSI_CH_RESET);
	gsi_channel_command(channel, GSI_CH_RESET);

	/* If successful the channel state will have changed */
	state = gsi_channel_state(channel);
@@ -627,7 +616,6 @@ static void gsi_channel_de_alloc_command(struct gsi *gsi, u32 channel_id)
	struct gsi_channel *channel = &gsi->channel[channel_id];
	struct device *dev = gsi->dev;
	enum gsi_channel_state state;
	int ret;

	state = gsi_channel_state(channel);
	if (state != GSI_CHANNEL_STATE_ALLOCATED) {
@@ -636,7 +624,7 @@ static void gsi_channel_de_alloc_command(struct gsi *gsi, u32 channel_id)
		return;
	}

	ret = gsi_channel_command(channel, GSI_CH_DE_ALLOC);
	gsi_channel_command(channel, GSI_CH_DE_ALLOC);

	/* If successful the channel state will have changed */
	state = gsi_channel_state(channel);