public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5.10-rt] rt: dma: fix build issue in at_hdmac
@ 2024-08-16  0:41 Luis Claudio R. Goncalves
  2024-08-16  6:46 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 4+ messages in thread
From: Luis Claudio R. Goncalves @ 2024-08-16  0:41 UTC (permalink / raw)
  To: linux-rt-users, stable-rt, Steven Rostedt,
	Sebastian Andrzej Siewior, Daniel Wagner, Tom Zanussi,
	Clark Williams, Mark Gross, Pavel Machek, Jeff Brady

The functions atc_advance_work() and atc_issue_pending() both have a
similar statement

    return spin_unlock_irqrestore(&atchan->lock, flags);

That results in the following errors during the build:

    drivers/dma/at_hdmac.c: In function ‘atc_advance_work’:
    ./include/linux/spinlock_rt.h:115:9: error: expected expression before ‘do’
      115 |         do {                                            \
          |         ^~
    drivers/dma/at_hdmac.c:487:24: note: in expansion of macro ‘spin_unlock_irqrestore’
      487 |                 return spin_unlock_irqrestore(&atchan->lock, flags);
          |                        ^~~~~~~~~~~~~~~~~~~~~~
    ./include/linux/spinlock_rt.h:115:9: error: ‘return’ with a value, in function returning void [-Werror=return-type]
      115 |         do {                                            \
          |         ^~
    drivers/dma/at_hdmac.c:487:24: note: in expansion of macro ‘spin_unlock_irqrestore’
      487 |                 return spin_unlock_irqrestore(&atchan->lock, flags);
          |                        ^~~~~~~~~~~~~~~~~~~~~~

Fix this by splitting the spin_unlock_irqrestore() call and the return
statement in both functions.

Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
---
 drivers/dma/at_hdmac.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Many thanks to Daniel Wagner who spotted and reported this build issue!

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 6a4f9697b574..bdbd85adeea9 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -483,8 +483,10 @@ static void atc_advance_work(struct at_dma_chan *atchan)
 	dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n");
 
 	spin_lock_irqsave(&atchan->lock, flags);
-	if (atc_chan_is_enabled(atchan) || list_empty(&atchan->active_list))
-		return spin_unlock_irqrestore(&atchan->lock, flags);
+	if (atc_chan_is_enabled(atchan) || list_empty(&atchan->active_list)) {
+		spin_unlock_irqrestore(&atchan->lock, flags);
+		return;
+	}
 
 	desc = atc_first_active(atchan);
 	/* Remove the transfer node from the active list. */
@@ -1477,8 +1479,10 @@ static void atc_issue_pending(struct dma_chan *chan)
 	dev_vdbg(chan2dev(chan), "issue_pending\n");
 
 	spin_lock_irqsave(&atchan->lock, flags);
-	if (atc_chan_is_enabled(atchan) || list_empty(&atchan->queue))
-		return spin_unlock_irqrestore(&atchan->lock, flags);
+	if (atc_chan_is_enabled(atchan) || list_empty(&atchan->queue)) {
+		spin_unlock_irqrestore(&atchan->lock, flags);
+		return;
+	}
 
 	desc = atc_first_queued(atchan);
 	list_move_tail(&desc->desc_node, &atchan->active_list);
-- 
2.46.0


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

end of thread, other threads:[~2024-08-16 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-16  0:41 [PATCH v5.10-rt] rt: dma: fix build issue in at_hdmac Luis Claudio R. Goncalves
2024-08-16  6:46 ` Sebastian Andrzej Siewior
2024-08-16  9:44   ` Luis Claudio R. Goncalves
2024-08-16 10:28     ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox