From: Shuah Khan <skhan@linuxfoundation.org>
To: rafael@kernel.org, james.morse@arm.com, tony.luck@intel.com,
bp@alien8.de, gregkh@linuxfoundation.org, keescook@chromium.org,
peterz@infradead.org
Cc: Shuah Khan <skhan@linuxfoundation.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 04/13] drivers/acpi/apei: convert seqno to seqnum_ops
Date: Fri, 13 Nov 2020 10:46:06 -0700 [thread overview]
Message-ID: <7e329c82fb30e9ccb9bcc2d5c56c24efcd924d0c.1605287778.git.skhan@linuxfoundation.org> (raw)
In-Reply-To: <cover.1605287778.git.skhan@linuxfoundation.org>
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@linuxfoundation.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..36ebecf36dfb 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 = SEQNUM_INIT(0);
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_return(&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
next prev parent reply other threads:[~2020-11-13 17:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 17:46 [PATCH v2 00/13] Introduce seqnum_ops Shuah Khan
2020-11-13 17:46 ` [PATCH v2 01/13] seqnum_ops: Introduce Sequence Number Ops Shuah Khan
2020-11-13 21:03 ` Matthew Wilcox
2020-11-16 14:49 ` Peter Zijlstra
2020-11-16 14:58 ` Peter Zijlstra
2020-11-17 14:50 ` Shuah Khan
2020-11-17 15:21 ` Peter Zijlstra
2020-11-17 16:34 ` Shuah Khan
2020-11-17 17:38 ` Matthew Wilcox
2020-11-17 18:23 ` Shuah Khan
2020-11-17 18:24 ` Shuah Khan
2020-11-16 14:53 ` Peter Zijlstra
2020-11-17 16:15 ` Shuah Khan
2020-11-13 17:46 ` [PATCH v2 02/13] selftests: lib:test_seqnum_ops: add new test for seqnum_ops Shuah Khan
2020-11-13 17:46 ` [PATCH v2 03/13] drivers/acpi: convert seqno seqnum_ops Shuah Khan
2020-11-13 17:46 ` Shuah Khan [this message]
2020-11-13 17:46 ` [PATCH v2 05/13] drivers/base/test/test_async_driver_probe: convert to use seqnum_ops Shuah Khan
2020-11-13 17:46 ` [PATCH v2 06/13] drivers/char/ipmi: convert stats " Shuah Khan
2020-11-13 17:46 ` [PATCH v2 07/13] drivers/edac: convert pci counters to seqnum_ops Shuah Khan
2020-11-13 17:46 ` [PATCH v2 08/13] drivers/oprofile: convert stats to use seqnum_ops Shuah Khan
2020-11-13 17:46 ` [PATCH v2 09/13] drivers/staging/rtl8723bs: " Shuah Khan
2020-11-13 17:46 ` [PATCH v2 10/13] usb: usbip/vhci: convert seqno to seqnum_ops Shuah Khan
2020-11-13 17:46 ` [PATCH v2 11/13] drivers/staging/rtl8188eu: convert stats to use seqnum_ops Shuah Khan
2020-11-13 17:46 ` [PATCH v2 12/13] drivers/staging/unisys/visorhba: " Shuah Khan
2020-11-13 17:46 ` [PATCH v2 13/13] security/integrity/ima: converts stats to seqnum_ops Shuah Khan
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=7e329c82fb30e9ccb9bcc2d5c56c24efcd924d0c.1605287778.git.skhan@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=bp@alien8.de \
--cc=gregkh@linuxfoundation.org \
--cc=james.morse@arm.com \
--cc=keescook@chromium.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=tony.luck@intel.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
all inboxes | Powered by JetHome®