]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
ras-page-isolation: fix location_fields size
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 19 Nov 2024 06:51:58 +0000 (07:51 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 19 Nov 2024 06:53:31 +0000 (07:53 +0100)
The location_fields is used for both APEI and DSM data.
The logic there defines 7 values for APEI and 9 for DSM,
but, with the current logic, it allocates only 7 elements.

This is likely due to a typo. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-page-isolation.h

index 25b02f853920fa4c8e482b572623309acfb6167b..048c72feafa495344d9e45a7a17a8f50445df9a1 100644 (file)
@@ -75,8 +75,8 @@ enum dsm_location_field_index {
        DSM_FIELD_NUM
 };
 
-#define  APEI_FIELD_NUM_CONST (int)APEI_FIELD_NUM
-#define  DSM_FIELD_NUM_CONST (int)DSM_FIELD_NUM
+#define  APEI_FIELD_NUM_CONST ((int)APEI_FIELD_NUM)
+#define  DSM_FIELD_NUM_CONST ((int)DSM_FIELD_NUM)
 
 struct memory_location_field {
        const char      *name;
@@ -92,7 +92,9 @@ struct page_addr {
        time_t                  start;
 };
 
-#define ROW_LOCATION_FIELDS_NUM (DSM_FIELD_NUM_CONST > DSM_FIELD_NUM_CONST ? DSM_FIELD_NUM_CONST : APEI_FIELD_NUM_CONST)
+#define ROW_LOCATION_FIELDS_NUM ((DSM_FIELD_NUM_CONST > APEI_FIELD_NUM_CONST ? \
+                                DSM_FIELD_NUM_CONST : APEI_FIELD_NUM_CONST))
+
 struct row_record {
        LIST_ENTRY(row_record)  entry;
        LIST_HEAD(page_listhead, page_addr)     page_head;