netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: ipa: fix some new build warnings
@ 2020-12-26 21:37 Alex Elder
  2020-12-26 21:37 ` [PATCH net 1/2] net: ipa: don't return a value from gsi_channel_command() Alex Elder
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alex Elder @ 2020-12-26 21:37 UTC (permalink / raw)
  To: davem, kuba
  Cc: evgreen, cpratapa, bjorn.andersson, subashab, netdev, linux-kernel

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.

I regret the error.

					-Alex

Alex Elder (2):
  net: ipa: don't return a value from gsi_channel_command()
  net: ipa: don't return a value from evt_ring_command()

 drivers/net/ipa/gsi.c | 38 +++++++++++++-------------------------
 1 file changed, 13 insertions(+), 25 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 1/2] net: ipa: don't return a value from gsi_channel_command()
  2020-12-26 21:37 [PATCH net 0/2] net: ipa: fix some new build warnings Alex Elder
@ 2020-12-26 21:37 ` Alex Elder
  2020-12-26 21:37 ` [PATCH net 2/2] net: ipa: don't return a value from evt_ring_command() Alex Elder
  2020-12-28 22:14 ` [PATCH net 0/2] net: ipa: fix some new build warnings Jakub Kicinski
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Elder @ 2020-12-26 21:37 UTC (permalink / raw)
  To: davem, kuba
  Cc: evgreen, cpratapa, bjorn.andersson, subashab, netdev,
	linux-kernel, kernel test robot

Callers of gsi_channel_command() no longer care whether the command
times out, and don't use what gsi_channel_command() returns.  Redefine
that function to have void return type.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 6ffddf3b3d182 ("net: ipa: use state to determine channel command success")
Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/gsi.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index 579cc3e516775..e51a770578990 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -454,7 +454,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 +489,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 +501,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 +510,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 +528,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 +537,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 +555,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 +571,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 +593,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 +606,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 +621,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 +629,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);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 2/2] net: ipa: don't return a value from evt_ring_command()
  2020-12-26 21:37 [PATCH net 0/2] net: ipa: fix some new build warnings Alex Elder
  2020-12-26 21:37 ` [PATCH net 1/2] net: ipa: don't return a value from gsi_channel_command() Alex Elder
@ 2020-12-26 21:37 ` Alex Elder
  2020-12-28 22:14 ` [PATCH net 0/2] net: ipa: fix some new build warnings Jakub Kicinski
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Elder @ 2020-12-26 21:37 UTC (permalink / raw)
  To: davem, kuba
  Cc: evgreen, cpratapa, bjorn.andersson, subashab, netdev,
	linux-kernel, kernel test robot

Callers of evt_ring_command() no longer care whether the command
times out, and don't use what evt_ring_command() returns.  Redefine
that function to have void return type.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 428b448ee764a ("net: ipa: use state to determine event ring command success")
Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/gsi.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index e51a770578990..14d9a791924bf 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -326,8 +326,8 @@ 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,
-			    enum gsi_evt_cmd_opcode opcode)
+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];
 	struct completion *completion = &evt_ring->completion;
@@ -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)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net 0/2] net: ipa: fix some new build warnings
  2020-12-26 21:37 [PATCH net 0/2] net: ipa: fix some new build warnings Alex Elder
  2020-12-26 21:37 ` [PATCH net 1/2] net: ipa: don't return a value from gsi_channel_command() Alex Elder
  2020-12-26 21:37 ` [PATCH net 2/2] net: ipa: don't return a value from evt_ring_command() Alex Elder
@ 2020-12-28 22:14 ` Jakub Kicinski
  2020-12-28 22:17   ` Alex Elder
  2 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2020-12-28 22:14 UTC (permalink / raw)
  To: Alex Elder
  Cc: davem, evgreen, cpratapa, bjorn.andersson, subashab, netdev,
	linux-kernel

On Sat, 26 Dec 2020 15:37:35 -0600 Alex Elder wrote:
> 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.
> 
> I regret the error.

If only it could have been caught with COMPILE_TEST.. ;)

Applied, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net 0/2] net: ipa: fix some new build warnings
  2020-12-28 22:14 ` [PATCH net 0/2] net: ipa: fix some new build warnings Jakub Kicinski
@ 2020-12-28 22:17   ` Alex Elder
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Elder @ 2020-12-28 22:17 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, evgreen, cpratapa, bjorn.andersson, subashab, netdev,
	linux-kernel

On 12/28/20 4:14 PM, Jakub Kicinski wrote:
> If only it could have been caught with COMPILE_TEST.. ;)

I know, I know!!!  I've had a branch that's half done
for a long time.  It has other dependencies that are
not set up for COMPILE_TEST so it's harder than I'd
like.  Let me see if I can make some headway on it
before the end of 2020.

Thank you.

					-Alex


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-28 23:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-26 21:37 [PATCH net 0/2] net: ipa: fix some new build warnings Alex Elder
2020-12-26 21:37 ` [PATCH net 1/2] net: ipa: don't return a value from gsi_channel_command() Alex Elder
2020-12-26 21:37 ` [PATCH net 2/2] net: ipa: don't return a value from evt_ring_command() Alex Elder
2020-12-28 22:14 ` [PATCH net 0/2] net: ipa: fix some new build warnings Jakub Kicinski
2020-12-28 22:17   ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).