diff mbox series

spi: Drop warning from spi_stop_queue()

Message ID 20230916161235.1050176-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted
Commit 9386c958beb77aee0d95d5fd0c79babd06a86c7d
Headers show
Series spi: Drop warning from spi_stop_queue() | expand

Commit Message

Uwe Kleine-König Sept. 16, 2023, 4:12 p.m. UTC
Both callers of spi_stop_queue() (i.e. spi_destroy_queue() and
spi_controller_suspend()) already emit an error message if
spi_stop_queue() fails. Another warning in this case isn't helpful, so
drop it.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi.c | 4 ----
 1 file changed, 4 deletions(-)


base-commit: dfa449a58323de195773cf928d99db4130702bf7

Comments

Mark Brown Sept. 18, 2023, 3:45 p.m. UTC | #1
On Sat, 16 Sep 2023 18:12:35 +0200, Uwe Kleine-König wrote:
> Both callers of spi_stop_queue() (i.e. spi_destroy_queue() and
> spi_controller_suspend()) already emit an error message if
> spi_stop_queue() fails. Another warning in this case isn't helpful, so
> drop it.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: Drop warning from spi_stop_queue()
      commit: 9386c958beb77aee0d95d5fd0c79babd06a86c7d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Geert Uytterhoeven Sept. 19, 2023, 7:26 a.m. UTC | #2
Hi Uwe,

On Sat, Sep 16, 2023 at 6:14 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> Both callers of spi_stop_queue() (i.e. spi_destroy_queue() and
> spi_controller_suspend()) already emit an error message if
> spi_stop_queue() fails. Another warning in this case isn't helpful, so
> drop it.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks for your patch, which is now commit 9386c958beb77aee ("spi:
Drop warning from spi_stop_queue()") in spi/for-next.

> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -2093,10 +2093,6 @@ static int spi_stop_queue(struct spi_controller *ctlr)
>
>         spin_unlock_irqrestore(&ctlr->queue_lock, flags);
>
> -       if (ret) {
> -               dev_warn(&ctlr->dev, "could not stop message queue\n");
> -               return ret;
> -       }
>         return ret;
>  }

Why did you decide to remove the printed warning from the callee,
instead of the multiple printed warnings from the callers?
The alternative would have reduced kernel size a bit more.

Gr{oetje,eeting}s,

                        Geert
Uwe Kleine-König Sept. 19, 2023, 8:18 a.m. UTC | #3
On Tue, Sep 19, 2023 at 09:26:42AM +0200, Geert Uytterhoeven wrote:
> Hi Uwe,
> 
> On Sat, Sep 16, 2023 at 6:14 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > Both callers of spi_stop_queue() (i.e. spi_destroy_queue() and
> > spi_controller_suspend()) already emit an error message if
> > spi_stop_queue() fails. Another warning in this case isn't helpful, so
> > drop it.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Thanks for your patch, which is now commit 9386c958beb77aee ("spi:
> Drop warning from spi_stop_queue()") in spi/for-next.
> 
> > --- a/drivers/spi/spi.c
> > +++ b/drivers/spi/spi.c
> > @@ -2093,10 +2093,6 @@ static int spi_stop_queue(struct spi_controller *ctlr)
> >
> >         spin_unlock_irqrestore(&ctlr->queue_lock, flags);
> >
> > -       if (ret) {
> > -               dev_warn(&ctlr->dev, "could not stop message queue\n");
> > -               return ret;
> > -       }
> >         return ret;
> >  }
> 
> Why did you decide to remove the printed warning from the callee,
> instead of the multiple printed warnings from the callers?
> The alternative would have reduced kernel size a bit more.

The callers used dev_err, the removed message is a dev_warn. So I kept
the messages with the higher prio.

Also the two error messages are more specific:

	spi_destroy_queue()
	-> dev_err(&ctlr->dev, "problem destroying queue\n");
	spi_controller_suspend()
	-> dev_err(&ctlr->dev, "queue stop failed\n");

But I didn't think about size reduction, if you want to improve further,
you're welcome.

Best regards
Uwe
diff mbox series

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 8d6304cb061e..ac518be34917 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2093,10 +2093,6 @@  static int spi_stop_queue(struct spi_controller *ctlr)
 
 	spin_unlock_irqrestore(&ctlr->queue_lock, flags);
 
-	if (ret) {
-		dev_warn(&ctlr->dev, "could not stop message queue\n");
-		return ret;
-	}
 	return ret;
 }