From: Gavin Shan <gshan@redhat.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Jonathan.Cameron@huawei.com,
james.morse@arm.com, mark.rutland@arm.com,
catalin.marinas@arm.com, will@kernel.org, shan.gavin@gmail.com
Subject: [PATCH v5 13/13] firmware: arm_sdei: Remove _sdei_event_unregister()
Date: Tue, 22 Sep 2020 23:04:23 +1000 [thread overview]
Message-ID: <20200922130423.10173-14-gshan@redhat.com> (raw)
In-Reply-To: <20200922130423.10173-1-gshan@redhat.com>
_sdei_event_unregister() is called by sdei_event_unregister() and
sdei_device_freeze(). _sdei_event_unregister() covers the shared
and private events, but sdei_device_freeze() only covers the shared
events. So the logic to cover the private events isn't needed by
sdei_device_freeze().
sdei_event_unregister sdei_device_freeze
_sdei_event_unregister sdei_unregister_shared
_sdei_event_unregister
This removes _sdei_event_unregister(). Its logic is moved to its
callers accordingly. This shouldn't cause any logical changes.
Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: James Morse <james.morse@arm.com>
---
drivers/firmware/arm_sdei.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c
index 361d142ad2a8..840754dcc6ca 100644
--- a/drivers/firmware/arm_sdei.c
+++ b/drivers/firmware/arm_sdei.c
@@ -487,16 +487,6 @@ static void _local_event_unregister(void *data)
sdei_cross_call_return(arg, err);
}
-static int _sdei_event_unregister(struct sdei_event *event)
-{
- lockdep_assert_held(&sdei_events_lock);
-
- if (event->type == SDEI_EVENT_TYPE_SHARED)
- return sdei_api_event_unregister(event->event_num);
-
- return sdei_do_cross_call(_local_event_unregister, event);
-}
-
int sdei_event_unregister(u32 event_num)
{
int err;
@@ -517,7 +507,11 @@ int sdei_event_unregister(u32 event_num)
event->reenable = false;
spin_unlock(&sdei_list_lock);
- err = _sdei_event_unregister(event);
+ if (event->type == SDEI_EVENT_TYPE_SHARED)
+ err = sdei_api_event_unregister(event->event_num);
+ else
+ err = sdei_do_cross_call(_local_event_unregister, event);
+
if (err)
goto unlock;
@@ -543,7 +537,7 @@ static int sdei_unregister_shared(void)
if (event->type != SDEI_EVENT_TYPE_SHARED)
continue;
- err = _sdei_event_unregister(event);
+ err = sdei_api_event_unregister(event->event_num);
if (err)
break;
}
--
2.23.0
next prev parent reply other threads:[~2020-09-22 13:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 13:04 [PATCH v5 00/13] Refactor SDEI client driver Gavin Shan
2020-09-22 13:04 ` [PATCH v5 01/13] firmware: arm_sdei: Remove sdei_is_err() Gavin Shan
2020-09-22 13:04 ` [PATCH v5 02/13] firmware: arm_sdei: Common block for failing path in sdei_event_create() Gavin Shan
2020-09-22 13:04 ` [PATCH v5 03/13] firmware: arm_sdei: Retrieve event number from event instance Gavin Shan
2020-09-22 13:04 ` [PATCH v5 04/13] firmware: arm_sdei: Avoid nested statements in sdei_init() Gavin Shan
2020-09-22 13:04 ` [PATCH v5 05/13] firmware: arm_sdei: Unregister driver on error " Gavin Shan
2020-09-22 13:04 ` [PATCH v5 06/13] firmware: arm_sdei: Remove duplicate check in sdei_get_conduit() Gavin Shan
2020-09-22 13:04 ` [PATCH v5 07/13] firmware: arm_sdei: Remove redundant error message in sdei_probe() Gavin Shan
2020-09-22 13:04 ` [PATCH v5 08/13] firmware: arm_sdei: Remove while loop in sdei_event_register() Gavin Shan
2020-09-22 13:04 ` [PATCH v5 09/13] firmware: arm_sdei: Remove while loop in sdei_event_unregister() Gavin Shan
2020-09-22 13:04 ` [PATCH v5 10/13] firmware: arm_sdei: Cleanup on cross call function Gavin Shan
2020-09-22 13:04 ` [PATCH v5 11/13] firmware: arm_sdei: Introduce sdei_do_local_call() Gavin Shan
2020-09-22 13:04 ` [PATCH v5 12/13] firmware: arm_sdei: Remove _sdei_event_register() Gavin Shan
2020-09-22 13:04 ` Gavin Shan [this message]
2020-09-28 22:13 ` [PATCH v5 00/13] Refactor SDEI client driver Will Deacon
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=20200922130423.10173-14-gshan@redhat.com \
--to=gshan@redhat.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=shan.gavin@gmail.com \
--cc=will@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).