Linux EFI development
 help / color / mirror / Atom feed
From: Tyler Baicar <tbaicar-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Matt Fleming
	<matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>,
	Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	James Morse <james.morse-5wv7dgnIgG8@public.gmane.org>,
	Andy Shevchenko
	<andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH V2 1/2] efi: move ARM CPER code to new file
Date: Mon, 11 Dec 2017 16:06:11 -0500	[thread overview]
Message-ID: <1bcd0462-5df9-fd90-c487-4e8958a9e27d@codeaurora.org> (raw)
In-Reply-To: <972fe421-696b-cd26-9145-20081fb733c9-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On 12/7/2017 3:07 PM, Tyler Baicar wrote:
> On 12/7/2017 2:38 PM, Ard Biesheuvel wrote:
>>> diff --git a/include/linux/cper.h b/include/linux/cper.h
>>> index 723e952..0a2d5c5 100644
>>> --- a/include/linux/cper.h
>>> +++ b/include/linux/cper.h
>>> @@ -494,6 +494,13 @@ struct cper_sec_pcie {
>>>   /* Reset to default packing */
>>>   #pragma pack()
>>>
>>> +static const char * const proc_error_type_strs[] = {
>>> +       "cache error",
>>> +       "TLB error",
>>> +       "bus error",
>>> +       "micro-architectural error",
>>> +};
>>> +
>> Could we keep this in cper.c, and replace this with
>>
>> extern const char * const cper_proc_error_type_strs[];
>>
>> instead? I'm not too keen on putting definitions (other than static
>> inline functions) in header files.
>>
> Yes, I will make this change.
Hello Ard,

This actually won't work because of the ARRAY_SIZE use. If this definition is in 
cper.c, then cper-arm.c won't be able to use ARRAY_SIZE even with the extern 
statement in cper.h.

drivers/firmware/efi/cper-arm.c: In function ‘cper_print_proc_arm’:
./include/linux/kernel.h:71:32: error: invalid application of ‘sizeof’ to 
incomplete type ‘const char * const[]’
  #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                                 ^
drivers/firmware/efi/cper-arm.c:103:21: note: in expansion of macro ‘ARRAY_SIZE’
     err_info->type < ARRAY_SIZE(cper_proc_error_type_strs) ?
                      ^~~~~~~~~~

Any other suggestions?

Thanks,
Tyler

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

  parent reply	other threads:[~2017-12-11 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 19:25 [PATCH V2 0/2] CPER ARM error information parsing Tyler Baicar
     [not found] ` <1512674727-25770-1-git-send-email-tbaicar-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-12-07 19:25   ` [PATCH V2 1/2] efi: move ARM CPER code to new file Tyler Baicar
     [not found]     ` <1512674727-25770-2-git-send-email-tbaicar-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-12-07 19:38       ` Ard Biesheuvel
     [not found]         ` <CAKv+Gu_kM1NLWcOtQSEwEVnncBbrgJ5MP4VrYQVHBoCwSf_FRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-07 20:07           ` Tyler Baicar
     [not found]             ` <972fe421-696b-cd26-9145-20081fb733c9-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-12-11 21:06               ` Tyler Baicar [this message]
     [not found]                 ` <1bcd0462-5df9-fd90-c487-4e8958a9e27d-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-12-11 21:09                   ` Ard Biesheuvel
     [not found]                     ` <CAKv+Gu_VWjw6E0GHc1edLAc-NVjy6CtDU2fSR5o7-Q+W40Fbug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-11 21:29                       ` Tyler Baicar
     [not found]                         ` <6c9da127-f210-3f14-32b7-c38ad5e0e1d6-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-12-11 23:17                           ` Ard Biesheuvel
2017-12-07 19:25   ` [PATCH V2 2/2] efi: parse ARM error information value Tyler Baicar

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=1bcd0462-5df9-fd90-c487-4e8958a9e27d@codeaurora.org \
    --to=tbaicar-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
    --cc=andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=james.morse-5wv7dgnIgG8@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.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