Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1654590 > unrolled thread
| Started by | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| First post | 2017-05-31 21:50 +0200 |
| Last post | 2017-06-05 23:30 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 4/5] ACPI / extlog: Switch to use new generic UUID API Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-31 21:50 +0200
Re: [PATCH v2 4/5] ACPI / extlog: Switch to use new generic UUID API Christoph Hellwig <hch@lst.de> - 2017-06-05 18:10 +0200
Re: [PATCH v2 4/5] ACPI / extlog: Switch to use new generic UUID API Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-06-05 18:30 +0200
Re: [PATCH v2 4/5] ACPI / extlog: Switch to use new generic UUID API Christoph Hellwig <hch@lst.de> - 2017-06-05 23:30 +0200
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Date | 2017-05-31 21:50 +0200 |
| Subject | [PATCH v2 4/5] ACPI / extlog: Switch to use new generic UUID API |
| Message-ID | <tNhN1-CQ-47@gated-at.bofh.it> |
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do
the conversion here.
Cc: Borislav Petkov <bp@suse.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/acpi/acpi_extlog.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
index 502ea4dc2080..6b101d595ccc 100644
--- a/drivers/acpi/acpi_extlog.c
+++ b/drivers/acpi/acpi_extlog.c
@@ -141,9 +141,9 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
int cpu = mce->extcpu;
struct acpi_hest_generic_status *estatus, *tmp;
struct acpi_hest_generic_data *gdata;
- const uuid_le *fru_id = &NULL_UUID_LE;
+ const guid_t *fru_id = &guid_null;
char *fru_text = "";
- uuid_le *sec_type;
+ guid_t *sec_type;
static u32 err_seq;
estatus = extlog_elog_entry_check(cpu, bank);
@@ -165,11 +165,11 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
err_seq++;
gdata = (struct acpi_hest_generic_data *)(tmp + 1);
if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
- fru_id = (uuid_le *)gdata->fru_id;
+ fru_id = (guid_t *)gdata->fru_id;
if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT)
fru_text = gdata->fru_text;
- sec_type = (uuid_le *)gdata->section_type;
- if (!uuid_le_cmp(*sec_type, CPER_SEC_PLATFORM_MEM)) {
+ sec_type = (guid_t *)gdata->section_type;
+ if (!guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
struct cper_sec_mem_err *mem = (void *)(gdata + 1);
if (gdata->error_data_length >= sizeof(*mem))
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,
@@ -182,17 +182,17 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
static bool __init extlog_get_l1addr(void)
{
- u8 uuid[16];
+ guid_t guid;
acpi_handle handle;
union acpi_object *obj;
- acpi_str_to_uuid(extlog_dsm_uuid, uuid);
-
+ if (guid_parse(extlog_dsm_uuid, &guid))
+ return false;
if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
return false;
- if (!acpi_check_dsm(handle, uuid, EXTLOG_DSM_REV, 1 << EXTLOG_FN_ADDR))
+ if (!acpi_check_dsm(handle, guid.b, EXTLOG_DSM_REV, 1 << EXTLOG_FN_ADDR))
return false;
- obj = acpi_evaluate_dsm_typed(handle, uuid, EXTLOG_DSM_REV,
+ obj = acpi_evaluate_dsm_typed(handle, guid.b, EXTLOG_DSM_REV,
EXTLOG_FN_ADDR, NULL, ACPI_TYPE_INTEGER);
if (!obj) {
return false;
--
2.11.0
[toc] | [next] | [standalone]
| From | Christoph Hellwig <hch@lst.de> |
|---|---|
| Date | 2017-06-05 18:10 +0200 |
| Subject | Re: [PATCH v2 4/5] ACPI / extlog: Switch to use new generic UUID API |
| Message-ID | <tP2JP-54T-15@gated-at.bofh.it> |
| In reply to | #1654590 |
> @@ -165,11 +165,11 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
> err_seq++;
> gdata = (struct acpi_hest_generic_data *)(tmp + 1);
> if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
> - fru_id = (uuid_le *)gdata->fru_id;
> + fru_id = (guid_t *)gdata->fru_id;
> if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT)
> fru_text = gdata->fru_text;
> - sec_type = (uuid_le *)gdata->section_type;
> - if (!uuid_le_cmp(*sec_type, CPER_SEC_PLATFORM_MEM)) {
> + sec_type = (guid_t *)gdata->section_type;
From a quick look over the tree it seems like both fru_id and
section_type should be declared as guid_t in
struct acpi_hest_generic_data.
> + if (!guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
The "!" seems incorrect here.
[toc] | [prev] | [next] | [standalone]
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Date | 2017-06-05 18:30 +0200 |
| Message-ID | <tP33g-5dS-127@gated-at.bofh.it> |
| In reply to | #1657697 |
On Mon, 2017-06-05 at 18:06 +0200, Christoph Hellwig wrote:
> > @@ -165,11 +165,11 @@ static int extlog_print(struct notifier_block
> > *nb, unsigned long val,
> > err_seq++;
> > gdata = (struct acpi_hest_generic_data *)(tmp + 1);
> > if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
> > - fru_id = (uuid_le *)gdata->fru_id;
> > + fru_id = (guid_t *)gdata->fru_id;
> > if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT)
> > fru_text = gdata->fru_text;
> > - sec_type = (uuid_le *)gdata->section_type;
> > - if (!uuid_le_cmp(*sec_type, CPER_SEC_PLATFORM_MEM)) {
> > + sec_type = (guid_t *)gdata->section_type;
>
> From a quick look over the tree it seems like both fru_id and
> section_type should be declared as guid_t in
> struct acpi_hest_generic_data.
They are arrays of 16 u8:s.
And since it's defined in ACPI table definition I'm not sure we can
change it.
>
> > + if (!guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
>
> The "!" seems incorrect here.
Right.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@lst.de> |
|---|---|
| Date | 2017-06-05 23:30 +0200 |
| Subject | Re: [PATCH v2 4/5] ACPI / extlog: Switch to use new generic UUID API |
| Message-ID | <tP7Jw-8a4-11@gated-at.bofh.it> |
| In reply to | #1657787 |
On Mon, Jun 05, 2017 at 07:23:05PM +0300, Andy Shevchenko wrote: > > From a quick look over the tree it seems like both fru_id and > > section_type should be declared as guid_t in > > struct acpi_hest_generic_data. > > > They are arrays of 16 u8:s. As is the guid_t. > And since it's defined in ACPI table definition I'm not sure we can > change it. If we always use 16 u8s as guid_t we might as well define the structure as such, instead of all the casts that remove type safety.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web