From: "Luis Claudio R. Goncalves" <lgoncalv@redhat.com>
To: linux-rt-users <linux-rt-users@vger.kernel.org>,
stable-rt <stable-rt@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Daniel Wagner <daniel.wagner@suse.com>,
Tom Zanussi <tom.zanussi@linux.intel.com>,
Clark Williams <williams@redhat.com>,
Mark Gross <markgross@kernel.org>, Pavel Machek <pavel@denx.de>,
Jeff Brady <jeffreyjbrady@gmail.com>
Subject: [PATCH v5.10-rt] rt: dma: fix build issue in at_hdmac
Date: Thu, 15 Aug 2024 21:41:03 -0300 [thread overview]
Message-ID: <Zr6gH7SNsAD0LHWV@uudg.org> (raw)
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
next reply other threads:[~2024-08-16 0:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-16 0:41 Luis Claudio R. Goncalves [this message]
2024-08-16 6:46 ` [PATCH v5.10-rt] rt: dma: fix build issue in at_hdmac Sebastian Andrzej Siewior
2024-08-16 9:44 ` Luis Claudio R. Goncalves
2024-08-16 10:28 ` Sebastian Andrzej Siewior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zr6gH7SNsAD0LHWV@uudg.org \
--to=lgoncalv@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=daniel.wagner@suse.com \
--cc=jeffreyjbrady@gmail.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=pavel@denx.de \
--cc=rostedt@goodmis.org \
--cc=stable-rt@vger.kernel.org \
--cc=tom.zanussi@linux.intel.com \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox