Re: [PATCH V2 1/2] efi: move ARM CPER code to new file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/11/2017 4:09 PM, Ard Biesheuvel wrote:
On 11 December 2017 at 21:06, Tyler Baicar <tbaicar@xxxxxxxxxxxxxx> wrote:
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?

Add '4' between the square brackets?
That works if you'd prefer it that way.

--
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.

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux