[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <d0f4ecaf408f2ea1d8cbb719b4fcabf969749c04.1612314468.git.skhan@linuxfoundation.org>
Date: Wed, 3 Feb 2021 11:12:00 -0700
From: Shuah Khan <skhan@...uxfoundation.org>
To: corbet@....net, gregkh@...uxfoundation.org, peterz@...radead.org,
keescook@...omium.org, rafael@...nel.org, lenb@...nel.org,
james.morse@....com, tony.luck@...el.com, bp@...en8.de
Cc: Shuah Khan <skhan@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-acpi@...r.kernel.org, linux-kselftest@...r.kernel.org,
devel@...verdev.osuosl.org
Subject: [PATCH v3 4/7] drivers/acpi/apei: convert seqno to seqnum_ops
Sequence Number api provides interfaces for unsigned atomic up counters
leveraging atomic_t and atomic64_t ops underneath.
Convert seqno atomic counter to use seqnum_ops.
Signed-off-by: Shuah Khan <skhan@...uxfoundation.org>
---
drivers/acpi/apei/ghes.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index fce7ade2aba9..103f67edee1a 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -41,6 +41,7 @@
#include <linux/uuid.h>
#include <linux/ras.h>
#include <linux/task_work.h>
+#include <linux/seqnum_ops.h>
#include <acpi/actbl1.h>
#include <acpi/ghes.h>
@@ -625,8 +626,7 @@ static void __ghes_print_estatus(const char *pfx,
const struct acpi_hest_generic *generic,
const struct acpi_hest_generic_status *estatus)
{
- static atomic_t seqno;
- unsigned int curr_seqno;
+ static struct seqnum32 seqno;
char pfx_seq[64];
if (pfx == NULL) {
@@ -636,8 +636,8 @@ static void __ghes_print_estatus(const char *pfx,
else
pfx = KERN_ERR;
}
- curr_seqno = atomic_inc_return(&seqno);
- snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx, curr_seqno);
+ snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx,
+ seqnum32_inc(&seqno));
printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n",
pfx_seq, generic->header.source_id);
cper_estatus_print(pfx_seq, estatus);
--
2.27.0
Powered by blists - more mailing lists